22Grand Central Dispatch
As mentioned in Chapter 10: Performance Tuning, we have reached the end of free performance as the transistors of new processors are being put into more and more cores rather than drastically speeding up existing cores.
Multi-threaded programming can be hard. You have race conditions, which can be fixed by locking, but it can be difficult to get the proper granularity of locking to prevent all of your threads from serializing on one code path. Finding the right locking granularity is hard. Make your locks too big, and they force serialization. Make them too small, and you drown in locking and unlocking overhead. Parallel algorithms also are more difficult to understand than serial algorithms, or at least they are not ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access