Let's Build dispatch_queue
mikeash.com
mikeash.com
Which is why articles like this are so great. When I was first dipping my toes into development, Mike Ash's articles were a great help in cutting through the marketing hype and realising that these are mostly things you could have implemented yourself given the time and inclination.
The whole point of it is that GCD is a lot more efficient than that because it is optimized across the whole system. The author intentionally chooses to omit this because he is trying to present a simplified example for educational purposes.
if([_blocks count] < idleThreads && _threadCount < _threadCountLimit) {
Shouldn't that be > idleThreads?For example, we can wrap a hash table in a dispatch queue: get() uses dispatch_sync, set() uses dispatch_async, and boom: our hash table rehashes in the background, instead of forcing set() to wait.
What are some other APIs that enable you to build a hash table like that?