Shared Mem, Msg queues, Semaphores Code fragments wanted
Guy Harris
guy at auspex.auspex.com
Fri Aug 4 04:30:30 AEST 1989
>SysV IPC is a poor solution for a very common problem. A better
>solution is a good implementation of named pipes for message queues,
I think S5R4 will have a way of attaching a stream to a file name, so
that users opening the file, in effect, establish a connection to the
process on the other end of the stream; I think that, unlike named
pipes, this works similarly to the "connect" socket call, so each
connection gets a unique descriptor in the server, so it can more easily
keep the conversations separate. The descriptor also refers to a
stream, so that e.g. message boundaries can be preserved.
>use a form of the /proc filesystem for shared memory,
Uhh, why "/proc"? That seems like a poor solution, too, especially
considering that the standard form won't work - you have to be the owner
of a process, or the super-user, to open its "/proc" file (for obvious
reasons!). Instead, what you want is to have some way of using a plain
file as the item at which the processes rendezvous; this can be done in
S5R4 by having both processes "mmap" the file MAP_SHARED, which maps the
file into their address space such that if you modify a page in the
mapped region it ends up modifying the file.
More information about the Comp.unix.questions
mailing list