Parallelizing Work with GCD

In order to increase performance of your application or framework, it behooves you to parallelize your work if possible. By batching together groups of similar work, you can take advantage of multi-core systems to increase the responsiveness and throughput of your code. Good candidates for parallelization are network downloads, resource fetching and loading, and computationally heavy calculations. To accomplish this, GCD provides a few built-in options and you can also use some of its primitives to create more sophisticated synchronization tools....

Protecting Critical Sections

When working on an application or framework, you eventually run into the problem of needing to do some work in a controlled environment. In order to guarantee the safety of the work being done, you want to lock down that particular path so that it can execute without state changing while it is running. This is what’s called a critical section. Luckily, the Apple development platform provides an abundance of options for implementing parallelizable code....