blocking for multiple sources
- From: "Jason S" <jmsachs@xxxxxxxxx>
- Date: 16 Aug 2006 12:21:31 -0700
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.
.
- Follow-Ups:
- Re: blocking for multiple sources
- From: Kenbo
- Re: blocking for multiple sources
- Prev by Date: Re: Newbie Question: How do I setup a transparent ethernet bridge on QNX 6.3.2 ?
- Next by Date: Re: blocking for multiple sources
- Previous by thread: qnx 4.25 SAC utility for qnx 6.3?
- Next by thread: Re: blocking for multiple sources
- Index(es):
Relevant Pages
|