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:48:01 -0800
On Jan 27, 2012, at 2:50 PM, Wade Tregaskis wrote:
>> It looks like I should just call dispatch_async, but I'm unsure which dispatch queue to use. dispatch_get_main_queue only works for the main thread. Can I use dispatch_get_current_queue? I'm unsure of what this does when called on a background thread. The API docs say "If the call is made from any other thread, this function returns the default concurrent queue" … is that a queue associated with the thread's runloop, that's guaranteed to execute tasks on that thread?
>
> Where do they say that? That's surely wrong.
Um, in the API docs for dispatch_get_current_queue.
file:///Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.AppleiOS5_0.iOSLibrary.docset/Contents/Resources/Documents/index.html#documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html#//apple_ref/c/func/dispatch_get_current_queue
—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