I am trying to make a language processor POSIX.1-1990 compliant as part of
my M.S. C.S. thesis project, and have hit a sticky spot.
I have a parent process that needs to pass messages of arbitrary length to
and from multiple child processes. The current implementation is using
SysV message queues.
The only POSIX.1 mechanisms that are available to me are pipes, and FIFOs;
I have written an implementation of binary semaphores based on POSIX.1
advisory locks (thanks to a suggestion in W. Richard Stevens' book!).
The type and length of each message is known before the writer has to write
the message.
The hard part seems to be making sure that the reader gets a complete message,
and NO MORE than a single complete message. If I could solve this, I could
create a linked-list of received messages, and provide a function call to
either fetch a message from the list, or block until another process writes
a message.
Any thoughts on how I should approach this?
Thanks,
--Malcolm
---
---------------------------------------------------------------------------
Motorola ASIC, Design Automation Phone: (602) 491-7182
OACS Tools and Architecture