Re: Semaphores in Mac
Re: Semaphores in Mac
- Subject: Re: Semaphores in Mac
- From: Mo McRoberts <email@hidden>
- Date: Wed, 8 Aug 2007 21:00:01 +0100
On 8-Aug-2007, at 19:49, JanakiRam wrote:
Hi ALL,
I'm new to the semaphores and their implementations in
Mac. Can any one clarify my following question(s).
i) I've seen that there are three implementations of
Semaphores i.e a) POSIX b) System V c) Mach Semaphores.
Which one is prefered for which scenario.
ii) Whats the difference between Mach Semaphores and
POSIX Semaphores.
Mach semaphores are (I believe) primarily a kernel to user-space
synchronisation primitive: the semaphore_create() and
semaphore_destroy() primitives aren't callable from user-space tasks.
On the other hand, SysV and POSIX semaphores aren't suitable for use
in-kernel.
The reference for Mach semaphores on Mac OS X can be found at http://
developer.apple.com/DOCUMENTATION/Darwin/Conceptual/KernelProgramming/
synchronization/chapter_15_section_2.html
SysV semaphores are supported by the vast majority of Unix-like systems
POSIX semaphores—I'm assuming you mean sem_open() et al, which are
more properly POSIX Realtime Extension Semaphores, are available on
those systems supporting them, which is a distinct subset of those
supporting SysV semaphores. On conformant systems, the semantics of
both SysV and POSIX realtime semaphores are as well-defined as
anything else.
Mo.
_______________________________________________
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