GCD basics
What is GCD (Grand Central Dispatch), and why do you hand work to a queue instead of creating threads yourself?
What is GCD (Grand Central Dispatch), and why do you hand work to a queue instead of creating threads yourself?
GCD is a concurrency API: you put work (a closure) on a queue and a thread pool the system manages runs it. Leaving thread creation, lifetime, and count to the system avoids thread explosion and wasted context switches.
ConcurrencyMultiple choiceIntro
Which of the following statements about sync/async and serial/concurrent queues are…
#dispatch-queue #serial #concurrent
ConcurrencyShort answerExpert
Design a MyQueue of your own without GCD. Submitting a closure with async(_:) should run…
#thread-pool #serial #concurrent
ConcurrencyMultiple choiceAdvanced
You call this function, which takes a GCD queue, from the main thread. About how many…
#gcd #serial #concurrent
ConcurrencyMultiple choiceBasics
What does this GCD code print? And does every call to queue.async create a new thread? …
#gcd #thread-pool #concurrent