Re: Can I create a thread with a runloop and a dispatch queue?
Re: Can I create a thread with a runloop and a dispatch queue?
- Subject: Re: Can I create a thread with a runloop and a dispatch queue?
- From: Jens Alfke <email@hidden>
- Date: Thu, 03 Oct 2013 14:37:04 -0700
On Oct 3, 2013, at 2:09 PM, Mike Abdullah <email@hidden> wrote:
> You can actually target a custom queue at any other queue you like, to create a whole chain of them. Work submitted to such queues ends up executing within the context of multiple queues at once.
OK, this I did not know, despite (I thought) reading docs. Is this from a WWDC session or release note? Is there an actual book (hopefully from O’Reilly) covering GCD? (Apple’s docs are OK as far as they go, but like all hypertext they have the problem that you’re never entirely sure you’ve read everything.)
> Ultimately, Apple are moving towards APIs (at least at the higher level) where clients explicitly specify the operation queue they'd like callbacks to be executed on. I think it would be wise to adopt that too.
Yeah, I can see that. It does have the problem that this knowledge has to be passed all the way down the call chain — if I a method I write is a client of such an API, then in order to know what queue I’m on, either my caller had to tell me or I have to be able to get it out of some state (like self). If that’s not true, then a bunch of refactoring may be needed to plumb the queue’s identity down to where it’s needed. But that problem isn’t unique to this, and it’s tractable.
—Jens
_______________________________________________
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