Re: How to count Atoms
Re: How to count Atoms
- Subject: Re: How to count Atoms
- From: Jens Alfke <email@hidden>
- Date: Sat, 08 Oct 2016 11:53:53 -0700
> On Oct 7, 2016, at 10:05 AM, Quincey Morris <email@hidden> wrote:
>
> Surely “anyone reading the code” is going to recognize “dispatch_semaphore” as something to do with a semaphore, including people from other platforms?
You’re right; I was [mis]remembering a classic semaphore as being a simple mutex lock, but a look at Wikipedia corrected me: it has the counting semantics that dispatch_semaphore does.
I still say it’s massive overkill to use it in a simple atomic increment task, as Gerriet’s performance figures show. You might still say that 80x faster isn’t important, but that depends on what you’re doing. I often work on highly performance-sensitive code, as Gerriet also does apparently.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden