[libdispatch-dev] Queue size

David Leimbach leimy2k at gmail.com
Tue Sep 28 15:37:06 PDT 2010

Your question makes me feel like I should try to clarify my understanding of
queues in libdispatch.  Here goes:

There's only one concurrent queue in which the "tasks" or blocks/function
pointers can be run in simultaneously as far as I can tell.  Every other
queue is serial, and the queues themselves may run in parallel and with
different priorities.

This is why it makes sense to think of a queue as a context, and that you're
serializing accesses to that context by enqueueing accesses and updates to
that queue.  The programmer's benefit in this situation is that they can
isolate queue contextual data in a nice way without thinking about mutexes
or semaphores etc, and the queues are really pretty inexpensive as can be
seen in the game of life demo sample code in libdispatch which I think is
using a queue per discrete element.


On Tue, Sep 28, 2010 at 1:30 PM, Danilo Egea <daniloegea at yahoo.com.br>wrote:

> First, sorry my english...
> Are possible define the queue size in GCD?
> Example: Define the max. number of task run simultaneous in a queue.
> --
> Danilo Egêa Gondolfo
> Email/MSN - daniloegea at yahoo.com.br
> Skype - daniloegea
> Twitter - http://twitter.com/daniloegea
> Blog - http://daniloegea.wordpress.com
> __________________________________________________
> Fale com seus amigos  de graça com o novo Yahoo! Messenger
> http://br.messenger.yahoo.com/
> _______________________________________________
> libdispatch-dev mailing list
> libdispatch-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/libdispatch-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/libdispatch-dev/attachments/20100928/bed1295c/attachment.html>

More information about the libdispatch-dev mailing list