mikeash.com pyblog/friday-qa-2013-08-16-lets-build-dispatch-groups.html commentshttp://www.mikeash.com/?page=pyblog/friday-qa-2013-08-16-lets-build-dispatch-groups.html#commentsmikeash.com Recent CommentsFri, 29 Mar 2024 08:42:08 GMTPyRSS2Gen-1.0.0http://blogs.law.harvard.edu/tech/rssPaul Fennema - 2013-10-29 08:42:41http://www.mikeash.com/?page=pyblog/friday-qa-2013-08-16-lets-build-dispatch-groups.html#commentsHi Mike, <br /> <br />What is the advantage to use your implementation (MADispatchGroup) instead of using the standard dispatch_group calls as in your excellent example?06bfb2b7aa5876f9c7b04e84e863da32Tue, 29 Oct 2013 08:42:41 GMTDaniel Steffen - 2013-08-17 19:00:27http://www.mikeash.com/?page=pyblog/friday-qa-2013-08-16-lets-build-dispatch-groups.html#commentsIt may be instructive to compare with the implementation in libdispatch: <br /><a href="http://libdispatch.macosforge.org/trac/browser/trunk/src/semaphore.c">http://libdispatch.macosforge.org/trac/browser/trunk/src/semaphore.c</a> <br /> <br />Note that <code>dispatch_group_notify</code> can be called multiple times for a single group (in addition to one or more <code>dispatch_group_wait</code>s), it maintains a queue of notifiers that is traversed when the group becomes empty. <br />&nbsp; <br />(<code>ma_dispatch_group_notify</code> also leaks the previous block if it is called more than once. That could be fixed with <code>__sync_swap</code> even if you didn't want to support more than a single notifier.)cc7e28b55932207061d2f368b4193490Sat, 17 Aug 2013 19:00:27 GMT