3 ms·
GCD is an abstraction that uses queues to communicate work items between pools of worker threads. It has much in common with the actor model in this regard. It
by rbarooah 16y ago
GCD is an abstraction that uses queues to communicate work items between pools of worker threads. It has much in common with the actor model in this regard. It doesn't immunize the programmer against race conditions, but it certainly does make them easier to avoid than using pthreads directly.
- pmjordan 16y agoUnfortunately, work queues aren't a great abstraction for serialisisg access to a shared resource. Given that all iOS devices so far have had a single CPU core, most uses of threading will have been for things like network I/O, audio, or running larger computations in a non-UI-thread, rather than dispatching work items to many CPUs. Furthermore, GCD has only been around since iOS 4.0, so if your app needs to be compatible to 3.x, you can't use it.