[Xastir-dev] Shared memory questions...

Greg Eigsti greg at eigsti.com
Tue Dec 19 18:09:11 EST 2006


Here comes a newbie question; I am fairly new to *nix programming and have a
question regarding forking and shared memory.

I am working on adding an http status page to xastir which shows xastir
status including connected TCP port status.  Most of this work is in
x_spider.c where the pipe_object structure is defined.  I have extended the
pipe_object structure to contain additional per user connection data.

The problem that I am having is that since the TCP_Server is forked (and it
'manages' the pipe_object list) any changes to the list are not reflected in
the other x_spider processes.

I investigated using shared memory to hold the pipe_object list but this
will turn into a huge hassle quickly if one considers the code that needs to
be written to manage the shared memory (and all the changes to the
implementation of the pipe_object list).

Another alternative is to change the forking of the TCP server (and my new
'status server') to be threads.  This would make it much easier for the TCP
server and 'status server' to share the pipe_object list.

Suggestions, warnings, hints, tips, tricks?

Thanks
Greg
KD7UBJ






More information about the Xastir-dev mailing list