[libdispatch-dev] Regarding dispatch_get_main_queue() and the thread it is actual executing on

Dave Zarzycki zarzycki at apple.com
Tue Apr 19 09:09:25 PDT 2011


On Apr 19, 2011, at 8:07 AM, Marius Zwicker wrote:

> I thought the main queue is available as a mean to be sure some blocks execute on the main thread (e.g. when updating the GUI is only possible while being on the main thread).


Marius,

That is only true if-and-only-if GCD is working in compatibility mode with Cocoa GUI logic, which for legacy reasons is bound to the main thread. If dispatch_main() is called, then GCD turns the main queue into a normal serial queue, with all of the performance advantages thereof.

davez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/libdispatch-dev/attachments/20110419/83b5e85f/attachment.html>


More information about the libdispatch-dev mailing list