On Apr 14, 2011, at 10:11 AM, WT wrote: > Hi Dave, > > thanks for replying. I must say some of what you said went above my head. :) > > On Apr 14, 2011, at 2:02 PM, Dave Zarzycki wrote: > >>> The first is that if the method gets invoked already in the queue's >>> automatic thread, there will be a deadlock. That's easy to fix, by wrapping >>> the dispatch call into a function that tests queue against the currently >>> executing queue and simply executes the block when they coincide. >> >> Actually, this isn't easy to fix due to X->A->B->A problems, where X is the >> current queue, then A, then B, and then the code deadlocks trying to >> dispatch_sync() against A "because it isn't the current queue". > > Why isn't the following deadlock-free?
Because once we subtract the layers of abstraction that your code is adding, we're left with this bug:
test.c
Description: Binary data
davez
_______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
