[libdispatch-dev] dispatch_suspend() does not affect child queues

Michael Roitzsch mroi at os.inf.tu-dresden.de
Mon Aug 6 03:46:15 PDT 2012

Hi Daniel,

>> If a queue A has its target set to queue B and queue B is suspended with dispatch_suspend(B), why are blocks from queue A still executed?
> they are not, but unless dispatch_suspend(B) is executed from B itself, suspension is asynchronous and non-preemptive, i.e. suspension only takes effect when queue state is checked before the next item on B is executed (but does not affect the current item on B).

I knew that it was non-preemptive, but I was not aware it was also asynchronous. But the manpage describes it that way, so I should have known.

> (queue A as a whole is a single workitem on queue B so queue A may stay the "current item" on queue B for many items on A)

That was the missing bit to complete my mental picture. Thanks a lot for your explanation.


More information about the libdispatch-dev mailing list