GCD vs OperationQueue
You're building an image pipeline: download, resize, then save to the disk cache, and when the user scrolls you need to cancel work in progress. Would you pick GCD or OperationQueue?
You're building an image pipeline: download, resize, then save to the disk cache, and when the user scrolls you need to cancel work in progress. Would you pick GCD or OperationQueue?
When you need dependencies, cancellation, a limit on concurrent work, and KVO state observation, OperationQueue fits better than GCD. GCD closures are fire and forget, so cancellation and dependencies aren't in the API.
ConcurrencyMultiple choiceIntro
Which of the following are appropriate ways to run work in the background (concurrency)…
#operationqueue #gcd
ConcurrencyShort answerIntro
What is GCD (Grand Central Dispatch), and why do you hand work to a queue instead of…
#gcd
ConcurrencyMultiple choiceBasics
In this cache built on a GCD concurrent queue, which statement about the role of the…
#gcd
ConcurrencyShort answerBasics
In Swift Concurrency, when you create a Task { }, when and where does that code run?
#cancellation