• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: runOnMainQueueWithoutDeadlocking and all its evils.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: runOnMainQueueWithoutDeadlocking and all its evils.


  • Subject: Re: runOnMainQueueWithoutDeadlocking and all its evils.
  • From: David Duncan <email@hidden>
  • Date: Fri, 06 Nov 2015 10:23:55 -0800

> On Nov 6, 2015, at 8:36 AM, Alex Zavatone <email@hidden> 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.
>
> - Alex Zavatone
>
>
>
>
>
> _______________________________________________
>
> 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

--
David Duncan


_______________________________________________

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


  • Follow-Ups:
    • Re: runOnMainQueueWithoutDeadlocking and all its evils.
      • From: Alex Zavatone <email@hidden>
    • Re: runOnMainQueueWithoutDeadlocking and all its evils.
      • From: Mike Abdullah <email@hidden>
References: 
 >runOnMainQueueWithoutDeadlocking and all its evils. (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: 'barHideOnSwipeGestureRecognizer' works with two UIScrollViews but not with two others
  • Next by Date: Re: -clickedRow
  • Previous by thread: runOnMainQueueWithoutDeadlocking and all its evils.
  • Next by thread: Re: runOnMainQueueWithoutDeadlocking and all its evils.
  • Index(es):
    • Date
    • Thread