Re: MACH_RCV_INTERRUPT
Re: MACH_RCV_INTERRUPT
- Subject: Re: MACH_RCV_INTERRUPT
- From: Jim Magee <email@hidden>
- Date: Fri, 8 Dec 2006 11:41:07 -0800
I try to live by the adage "The only good timeouts are immediate
timeouts." ;-)
But if you must use a non-zero/non-infinite timeout (and think long
and hard as to why), and that timeout is sufficiently large (so that
there is a reasonable expectation of it getting interrupted by signals
during the wait) then you must provide the MACH_RCV_INTERRUPT and/or
MACH_SEND_INTERRUPT options and recalculate the relative timeout
yourself (the mach_msg() library routine won't do that for you).
--Jim
On Dec 6, 2006, at 9:34 AM, Eric Grant wrote:
I am doing simple IPC with mach messages, and I need a timeout
mechanism.
The alternatives of which I am aware -- creating the receive port
using
mk_timer_create(), or waiting on a port set that includes a timer --
are
suboptimal in this situation.
As for mig, I am aware of it, but it doesn't seem necessary.
Everything
seems to be working fine (save for this timeout issue).
Thanks again,
Eric Grant
On 12/6/06 9:10 AM, "Dave Zarzycki" <email@hidden> wrote:
More to the point, how did you find yourself in such a scenario where
the answer to that question matters?
Have you considered using the tool called 'mig' to automate IPC stub
generation and demux?
davez
On Dec 6, 2006, at 9:02 AM, Dave Zarzycki wrote:
Why do you ask?
davez
On Dec 6, 2006, at 8:48 AM, Eric Grant wrote:
The mach_msg man page states:
If MACH_RCV_TIMEOUT is used without MACH_RCV_INTERRUPT, then
the timeout
duration might not be accurate. When the call is interrupted
and
automatically retried, the original timeout is used. If
interrupts occur
frequently enough, the timeout interval might never expire.
MACH_SEND_TIMEOUT without MACH_SEND_INTERRUPT suffers from the
same
problem.
http://www.opensource.apple.com/darwinsource/10.4.8.x86/xnu-792.13.8/osfmk/m
an/mach_msg.html.
Is this statement true for Darwin's implementation of mach?
_______________________________________________
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
_______________________________________________
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