Re: MPProcessing in Lion
Re: MPProcessing in Lion
- Subject: Re: MPProcessing in Lion
- From: Ken Thomases <email@hidden>
- Date: Mon, 14 May 2012 10:43:24 -0500
On May 14, 2012, at 8:52 AM, Glenn L. Austin wrote:
> Read up on Grand Central Dispatch. It can manage pretty much all of the hard work of parallelizing code, including replacing synchronization primitives like Mutexes and CriticalRegions (just access those sections on a single GCD queue with dispatch_sync, and you're guaranteed synchronous access).
For "single GCD queue", you should have said "single *serial* GCD queue". And you don't have to use dispatch_sync() to get synchronization among the tasks queue to a serial queue. You can use dispatch_async(). The difference between the two is whether the completion of the queued task is synchronous with the *caller*, not with each other. And, if at all possible, you should design your code to not need to use dispatch_sync().
Regards,
Ken
_______________________________________________
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