Re: Sending notification from a time-constraint thread
Re: Sending notification from a time-constraint thread
- Subject: Re: Sending notification from a time-constraint thread
- From: Mike Smith <email@hidden>
- Date: Wed, 16 Mar 2005 12:42:28 -0800
In a server/client system we are developing, we need a time-constraint
thread in the server to send a notification to another thread in the
server. We use MIG generated RPC calls to communicate between threads.
Why do you do this? Unless you mean "between client and server", you
would generally be much better off implementing a trivial messaging
system
using posix condition variables.
To be sure the time-constraint thread will not have to "wait" in any
case, our first try was to use a "simpleroutine" type of RPC thinking
that since return values were not expected, a simpleroutine would
simply send the Mach message and return immediately. But it seems not
to be the case, thus we tried to use a simpleroutine type of RPC with a
timeout value of 0. But now the simpleroutine calls sometimes fails
with a "error (ipc/send) timed out " message...
You have probably filled the receiver's queue.
Can this idea of notification be implemented using RPC calls with the
desired behaviour (never blocking the time-constraint thread)?
Or another strategy would be better?
The thread wakeup implicit in the use of cvars is less likely to block,
and since the queueing system for your notifications will be your own
design, you can tweak it to have whatever behaviour you desire.
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden