Re: Are Mach Semaphore Process Shared?
Re: Are Mach Semaphore Process Shared?
- Subject: Re: Are Mach Semaphore Process Shared?
- From: Terry Lambert <email@hidden>
- Date: Thu, 1 Oct 2009 20:40:34 -0700
You mean write the name to a socket and read the name on the other end
of the socket and then open the named semaphore in the other process?
Yes.
You mean assume that the integer you get back is actually an fd,
rather than an implementation detail that could change in the next SU,
and that proper reference counting on the semaphore is done when you
pass the fd around? No.
-- Terry
On Oct 1, 2009, at 7:22 PM, Abdulla Kamar wrote:
Mach ports are similar to file descriptors in the sense that the
mapping of name to port only exists within one process.
I don't know whether it's possible or not, but you may be able to
copy the mach port that represents the the semaphore (semaphore_t is
a typedef of mach_port_t) to the remote process by sending it as out-
of-line data in a mach message.
Ah okay, thanks for that. On a related note is it possible to pass a
POSIX named semaphore in Mac OS X over a UNIX socket?
--
Thank you
Abdulla
_______________________________________________
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
_______________________________________________
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