GCD Dispatcher Barrier Queues (iOS)

I create several parallel queues in my application. dispatch_barrier_syncused to change the share.

Will dispatch_barrier_syncparallel execution be blocked only in the current queue or in all queues?

For example, let's say I have 3 user parallel queues "A", "B" and "C". If I send a block dispatch_barrier_syncto queue "A", will it block parallel execution with "B" and "C"? Or only in "A"?

+3
source share
1 answer

Only A. Exactly this will not block anything. He will just wait until all tasks in are completed. B and C will work as usual and can call their blocks.

https://developer.apple.com/library/mac/documentation/performance/reference/gcd_libdispatch_ref/Reference/reference.html#//apple_ref/c/func/dispatch_barrier_sync

+2
source

All Articles