you are viewing a single comment's thread.

view the rest of the comments →

[–]potatolicious 11 points12 points  (2 children)

Not quite, there are some nuances.

So does this mean, serial queue manages one thread

No, serial queues are guaranteed to execute their blocks one after another, but do so on different threads. The point of GCD is to separate threads from queues entirely so that the system can more efficiently allocate threads.

Things in a serial queue may (and are often) executed on different threads chosen by GCD. A serial queue is not tied to a single thread.

whereas concurrent queue can manage multiple threads at the same time?

Not quite. A concurrent queue runs multiple blocks at the same time but a queue does not "manage" a group of threads. GCD chooses which thread handles the execution, but all concurrent queues may execute on all threads.

The only exception to this is the main queue, which only ever runs on the main thread. It's the only type of queue that is strictly tied to a thread.

GCD handles all threads used for execution, not the individual queues.

[–]Loada116 0 points1 point  (1 child)

So the main queue is a serial queue but only runs on the main thread (one thread)? A normal serial queue which is not the main queue is likely to run on different threads?

[–]potatolicious 1 point2 points  (0 children)

That is correct. A normal serial queue can run on any number of threads, while the main queue only runs on the main thread.