Re: What if process crashes while holding a locked semaphore?
Re: What if process crashes while holding a locked semaphore?
- Subject: Re: What if process crashes while holding a locked semaphore?
- From: Jerry Krinock <email@hidden>
- Date: Tue, 31 Mar 2009 07:43:29 -0700
On 2009 Mar 31, at 00:02, Chris Suter wrote:
... you could do what you want with Mach ports without any great
difficulty.
Very good, Chris. I'm an NSPortNameServer fan now. Your little code
works great -- the only change is that I needed to retain the NSPort
object, and then when work is done, send it an -[NSPort invalidate].
The system clears the named port when I crash the single process which
registered it. Yay! The only return value I need to deal with is the
one that tells me whether or not the named port is available. There
are no stupid errno`s to verbalize, no stupid descriptors, no stupid
#includes, no stupid MAX_VALUE`s. 130 lines of code are gone.
Thanks to everyone for the help.
If anyone who knows about semaphores thinks so, I'll file that bug on
the semaphores. Maybe the behavior is expected. Let me know.
Jerry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden