• 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: Waiting for callback with GCD: impossible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Waiting for callback with GCD: impossible?


  • Subject: Re: Waiting for callback with GCD: impossible?
  • From: Seth Willits <email@hidden>
  • Date: Wed, 08 Oct 2014 12:10:07 -0700

On Oct 8, 2014, at 11:59 AM, Jens Alfke <email@hidden> wrote:

> * Now, how does queue A wait for the callback? It seems to be impossible: the only way for code running on queue A to receive the callback is to return back to the queue dispatcher, so if it tries to wait it simply blocks the queue, causing a deadlock.
> …
> But given that dispatch queues can't do this, what's the solution to this design problem, i.e. turning an async call into a sync one?

Simply performing the rest of the task in the callback is one way.


--
Seth Willits




_______________________________________________

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


References: 
 >Waiting for callback with GCD: impossible? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Waiting for callback with GCD: impossible?
  • Next by Date: Re: Waiting for callback with GCD: impossible?
  • Previous by thread: Re: Waiting for callback with GCD: impossible?
  • Next by thread: Re: Waiting for callback with GCD: impossible?
  • Index(es):
    • Date
    • Thread