blocking for multiple sources



I am relatively new to qnx & am looking for either an equivalent to
Win32 WaitForMultipleObjects() or an application architecture change
that would get me there.

Is there a way to have a thread block until *either* a message is
received *or* there is data available on a file descriptor (like
select() does, but select() is limited to file descriptors), and then
figure out which one to handle?

I have a server running with a few threads to decouple some of the
timing requirements in my system. I have a main thread which manages
most of the computing & it runs using MsgReceive to serialize & wait
for incoming messages from the other threads.

One of my other threads' job is to queue up UDP packets for the main
thread. (i.e. the subthread listens on a UDP port, and for each UDP
packet it gets, it relays the packet to the main thread via MsgSend,
then when it gets a response, it sends the results back as a reply UDP
packet) This way the main thread has only one source of inputs
(incoming messages).

But occasionally I may need to have the main thread send a pulse to the
UDP worker thread -- at a minimum to have it shut down. I can't seem to
find a way to have the worker thread wait for either a new pulse or a
new UDP packet, though. In the absence of such a beast, it seems like I
would have to wait for pulses with a timeout, then wait for UDP packets
with a timeout using select(), and repeat. Bleah.

.



Relevant Pages

  • Re: blocking for multiple sources
    ... Your process would receive block waiting ... When the ionotify pulse is received you can go read the ... One of my other threads' job is to queue up UDP packets for the main ...
    (comp.os.qnx)
  • Re: tcludp - bug when closing 1-of-2 listening ports
    ... I'd say something like a zero-length UDP packet... ... It is indeed linked with zero-sized UDP packets. ... % puts -nonewline $s titi ... The zero-sized packet wreaks havoc in tcludp only if it comes on ...
    (comp.lang.tcl)
  • Re: receive delay
    ... UDP packets are used for new mail notifications, or in this case to notify ... the client is requesting the update instead of the server sending a UDP ... right of outlook, also under E-mail accounts the Use Cached mode is ... Something is blocking UDP packets. ...
    (microsoft.public.exchange.admin)
  • Re: Deaf CAsyncSocket on Windows Service.
    ... Note that for UDP, your network stack is free to discard, at any time, for any reason ... correlation between UDP packets sent and UDP packets received, ... UDP does not guarantee delivery, ... If you do a receive of fewer bytes than the UDP message, ...
    (microsoft.public.vc.mfc)
  • HTTPS Tunnel: how-to write...
    ... Our UDP packets are audio and video. ... Is a HTTPTunnel a solution that will enable us to send UDP to and ... server over port 80/433? ...
    (microsoft.public.win32.programmer.networks)