hi Mike! DispatchSemaphore is part of GCD, and is still useful.
Soroush Khanlou’s GCD Handbook shows a couple of uses.
However, Rob’s stack overflow answer advises against over-use of dispatch semaphores:
while the dispatch semaphore technique is a wonderful technique when absolutely needed, I must confess that I see too many new developers, unfamiliar with good asynchronous programming patterns, gravitate too quickly to semaphores as a general mechanism for making asynchronous routines behave synchronously.
And WWDC 2015 and 2016 GCD talks have pointed out that Apple’s priority inversion fix (promoting lower priority tasks) doesn’t work with dispatch semaphores, because they don’t have an owning task, so the system can’t tell where they’re being triggered.
Earlier in the WWDC 2015 talk, they discuss the use of serial queues as locks. Serial queues can take advantage of the priority inversion fix, so if that’s a factor in your project, you should try to use a serial queue. OTOH if it’s not broken … ;]