Improving on SYSV Msgs Queues

Kenneth Almquist ka at june.cs.washington.edu
Sun Apr 16 08:24:23 AEST 1989


fraser at mdivax1.uucp (Cameron Fraser) writes:
>
>	We build message switching systems to link our radio data networks
>	with various type of host computers.  ...  The inability to do the
>	equivalent of poll() or select() on multiple queues really hinders
>	design.

It may limit the design choices available to you, but I have a hard
time imagining a problem for which a select() call is actually needed.
Take your current design (using select) and each place where the code
does a select on a bunch of message queues, replace these queues with
a single queue.  Add an extra field to the messages to let you know
which of the queues in the original design each message was destined
for, if necessary.  If there are places where you want to do a select
on only a subset of the queues that have been merged into a single
queue, either uses the message type field to get only the messages you
want, or else read all messages and buffer the unwanted ones inside
the reader process for later processing.  If you merge two queues that
had different access permissions in the original design, you can still
get statistical security by writing a key manager that creates and
distributes passwords.

In conclusion, you are better off sticking with the existing message
facilities rather than extending them with a select operation--if the
existing facilities are adequate for what you want to do.  Without
knowing more about your application I can't say for *sure* that the
existing facilities are adequate, but I would be quite surprised if
they weren't.
				Kenneth Almquist



More information about the Comp.unix.wizards mailing list