On Nov 7, 2015, at 5:20 PM, Mike Abdullah wrote: > In my experience, the main issue is on OS X. If you ever display a modal > window, that runs the run loop in a special mode for the duration of the > window. The trouble is, that mode does not include dequeuing things from > GCD’s main queue, so anything you ask to be done that way doesn’t happen. > Faced with this myself, I’ve had to use performBlockOnMainThread:… instead to > get the work done. > > Mike.
Thanks much, Mike. Before I started to replace these, I wanted to see why these were being forced to the main queue and an alternative in case there some realities I didn't forsee. It will be quite nice to reduce the 60+ cases of use of these. Cheers > > >> On 6 Nov 2015, at 18:23, David Duncan <[email protected]> wrote: >> >>> >>> On Nov 6, 2015, at 8:36 AM, Alex Zavatone <[email protected]> wrote: >>> >>> Bearing in mind my experience dealing with code in the past that was chock >>> full of runOnMainQueueWithoutDeadlocking calls, I can not fathom why >>> someone who was not updating the UI would need to use this type of >>> approach… everywhere. >>> >>> Besides complete ineptitude, is there a rational reason that any one of you >>> can think of why someone would be using this for GCD dispatches instead of >>> just making and using their own GCD dispatch queue? >>> >>> Before I start destroying the universe and changing this (in a fork), I'd >>> like to hear the words of those much smarter than I on this subject. >>> >>> >>> But seriously, WHY? >> >> Roughly this approach reads like a lock that uses the main queue as its >> locking point. Without understanding what is being protected, it is hard to >> tell why this is being done. >> >> The usage of dispatch_sync() says that whomever wrote this expected to have >> the results available immediately. If not, then simply switching to >> dispatch_async() may be sufficient in many cases. Beyond that you will >> probably need to evaluate what work is being done in these cases. >> >>> >>> Thank you. _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
