Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Semaphores in Mac
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Semaphores in Mac




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


References: 
 >Semaphores in Mac (From: JanakiRam <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.