The underlying idea of a dispatch semaphore isn't difficult to understand. Remember that a semaphore is nothing more than a variable that can be incremented and decremented in a thread safe manner. The most challenging aspect of a dispatch semaphore is correctly using it. Working in a multithreaded environment is complex. Semaphores help you manage that complexity.
Subscribe to Cocoacasts Plus to watch this episode.
Mastering Grand Central Dispatch
Synchronizing Work With Dispatch Semaphores
by Bart Jacobs in Swift
Swift 4
Xcode 10
iOS 12
Mastering Grand Central Dispatch
-
1 What Is Grand Central Dispatch
07:40
-
2 Working With Dispatch Queues
10:22
-
4 Main and Global Dispatch Queues
09:04
-
10 Applying Quality of Service Classes
12:30
-
12 Simplifying With Dispatch Groups
08:42
-
14 Synchronizing Work With Dispatch Semaphores
14:39