Re: How to get the dispatch queue for the current thread's runloop?
Re: How to get the dispatch queue for the current thread's runloop?
- Subject: Re: How to get the dispatch queue for the current thread's runloop?
- From: Jens Alfke <email@hidden>
- Date: Fri, 27 Jan 2012 15:52:45 -0800
On Jan 27, 2012, at 2:52 PM, Kyle Sluder wrote:
> My understanding is that you should treat the thread pool owned by a
> dispatch queue as private. That means you probably shouldn't be
> running an NSRunLoop on a dispatch worker thread.
> If you need a thread (including cases where you need to run a
> runloop), spawn a thread.
I think you've got it backwards. You're assuming I've got a dispatch queue and want to know the thread. But what I've actually got is a thread and I want a dispatch queue that will run on that thread (in synchrony with the runloop.)
I don't know why this is so hard to explain! I just want a block-oriented alternative to the ubiquitous perform-selector-after-delay. It seems weird that there isn't one yet, since blocks have been available in two major OS releases so far.
—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