Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re(4): semaphores in Darwin



I guess we can just keep our fingers crossed for 10.4.x :).

On May 18, 2004, at 7:47 AM, Peter Lovell wrote:


On May 17, 2004, at 2:56 PM, Peter Lovell wrote:

Hi folks,
I notice that Darwin and Mac OS X doesn't implement Posix memory-based semaphores, but only named semaphores. That is, you can use sem_open but not sem_init (which returns ENOSYS).

Can anyone shed any light on why this is so??

Thanks.....Peter


On May 17, 2004, at 4:13 PM, David Leimbach wrote:

Perhaps because they have similar functionality in the mach_semaphore libraries?

I don't know why either. I filed a bug about this and it's stil "Open for review".

Hhmmm. Interesting. I wonder just what's to review? I would prefer to use Posix semaphores for reasons of code portability, and stay away from dependencies on mach. Named Posix semaphores will get the job done -- it's just that you have to avoid name collisions with multiple processes etc etc.

I'm not complaining about named ones -- if you were only doing one or other this would certainly be the better choice. I'm just puzzled that, having done the harder one (named), the easier one (memory) isn't there.



On May 17, 2004, at 4:20 PM, Dario wrote:
you can use semget, semctl, semop.
sorry but I have never used named semaphores

True. But these are System V semaphores, and I'd prefer to avoid them for the same reason I'm not using mach semaphores.


Thanks for the comments.....Peter
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.


References: 
 >stabs common symbols relocation (From: Jonas Maebe <email@hidden>)
 >semaphores in Darwin (From: Peter Lovell <email@hidden>)
 >Re: semaphores in Darwin (From: David Leimbach <email@hidden>)
 >Re(4): semaphores in Darwin (From: Peter Lovell <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.