The code in the linked article has a bug: it doesn't wait for the queued tasks to complete, so the program will exit while people are still waiting for their haircuts - or worse, while the barber's actually cutting some hair.<p>You can fix this by using dispatch_group_async instead of dispatch_async, then after the loop (before releasing the queue) call dispatch_group_wait to make sure all the queued blocks have completed.<p>This plus creating and releasing the group only adds three lines of code; the rest of the author's algorithm is correct as far I can tell.<p>I guess it just goes to show that even with Grand Central you still have to be a little careful.
Here's a good discussion on a related topic in the 9fans archive - <a href="http://www.mail-archive.com/9fans@9fans.net/msg10581.html" rel="nofollow">http://www.mail-archive.com/9fans@9fans.net/msg10581.html</a>