Summary: Is there a select()-like call for message queues?

Victor Kan kan at dg-rtp.dg.com
Sat Jan 6 01:27:14 AEST 1990


Here's a summary of replies to a question I posted a little while ago.
I asked if there's an analog to select() that works on message queue ids
rather than just file descriptors.

The general consensus is that there is no such beast on Unix.
BUT, IBM of all companies lets you use select() on message queue ids.
AIX!  Who would have thought?  I would guess Carnegie Mellon's 
(RT/PC Central) relationship with IBM may have brought about this 
innovation but no one's saying.

The only non-Unix OS mentioned in any of the replies was 
Trollius from Cornell.

From: guy at auspex.com (Guy Harris)
Not in standard UNIX.  One more reason why "System V IPC" (message
queues, semaphores, shared memory) is a bit of a crock; the mechanisms
are all stuck on the side of UNIX.

From: beers at tcgould.TN.CORNELL.EDU (Jim Beers)
We, were just discussing this a couple of weeks ago around here, at the
Trollius group.  We do not have such a call in Trollius, a message passing
operating system, and were told it is an obvious feature.  Intel has
a call, iprobe I think it is called.  So we are now considering adding
something like this into Trollius, but there are some questions about
whether or no it should be included.

From: mark at parc.xerox.com (Mark Weiser)
On SunOS (and all new System V conforming systems) there is the new "poll" syst\
em call.

[My man page for poll() mentions only STREAMS - vk].

From: tim at sybase.com (Tim Wood)
I haven't used those OS's myself, nor do I know in detail how
VMS or AOS do this (except I'm pretty certain VMS supports this
concept).  I would suggest, instead of using msgsend/recv, try
using sockets in the UNIX domain, i.e. socets which have file system
names.  Then you should be able to select() on their file descriptors.
Does your version of UNIX support this feature?  I believe it orginated
in the BSD 4.x socket library.

From: baur at venice.sedd.trw.com (Steven L. Baur)
You Lose!!!!!!!!!   (Sorry)

Message Queues have no equivalent to the select(2) system call.  And
further more, most System V's have no time resolution below one second.
Good luck, but you are fighting a losing (or lost) battle.

(I run system V boxes at home and sorely miss the loss of unix domain
sockets, struct timeval, select, and job control).

From: jason at cs.utexas.edu (Jason Levitt)
  Under AIX 2.2.1 on the IBM RT, the select(2) system call works
  with message queues. As far as I know, though, this is the only
  implementation. IBM, for some strange reason, has also chosen to implement
  distributed message queues as well i.e. your local msg queue id can actually
  be attached to a msg queue on another machine in the LAN.
  Anyway, if you're using the RT, you *can* use select(2) with message queues!


| Victor Kan               | I speak only for myself.               |  ***
| Data General Corporation | Edito cum Emacs, ergo sum.             | ****
| 62 T.W. Alexander Drive  | Columbia Lions Win, 9 October 1988 for | **** %%%%
| RTP, NC  27709           | a record of 1-44.  Way to go, Lions!   |  *** %%%



More information about the Comp.unix.questions mailing list