From: martin@mjedev.demon.co.uk (Martin J. Evans)
Subject: Re: Can "select" multiplex IPC message queues on DEC UNIX?
Date: 1996/09/05 [thread overview]
Message-ID: <322f5ea3.5673438@news.demon.co.uk> (raw)
In-Reply-To: ygdenkqdvng.fsf@bart.sed.stel.com
Ken Reed <kenr@sed.stel.com> wrote:
>
>I want to receive messages on sockets (from a remote system) and from
>local processes over IPC queues. It's not clear to me from the manual
>pages if the message queue ID used by the IPC routines (msgrcv,
>msgget, etc) are file descriptors that will work with select.
>
>Anyone know the answer?
>
>Ken
>
I've not got a Digital UNIX machine in front of me now so it's difficult for
me to check but from what I remember from other Unixes (HP-UX, Solaris, AIX
etc) you get an identifier back from the routine that creates (or obtains) a
message queue and not a file descriptor. A such, you cannot use select() as
it only works with file descriptors.
However, there are if my memory serves me well, functions for returning the
number of messages on an IPC message queue and so you could possibly write
your own select() which combines socket file descriptors and message queue
identifiers so long as you did not want to implement the timout facility
that select() normally provides. This solution would most probably result in
some sort of wasteful cpu intensive loop but that might not matter to you.
The company I work for has some code that processes messages arriving on
sockets and messages arriving on IPC message queues but the frequncy of the
IPC messages is far less than that on the sockets. The code occasionally
looks at the message queues which receive client requests but mainly gives
priority to data arriving on the socket.
Martin
--
Martin J. Evans (martin@mjedev.demon.co.uk)
Leeds, UK
prev parent reply other threads:[~1996-09-05 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-08-29 4:00 Can "select" multiplex IPC message queues on DEC UNIX? Ken Reed
1996-09-05 4:00 ` Martin J. Evans [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox