I've begun controlling queues for the first time and feel like I have a good handle on how to use them and kudos to Apple for making them quite straightforward to use.
What I encountered, however, is the challenge of multiple threads reading and writing to the same objects. In this question I got this fine answer, and it leaves me asking for some confirmation from everyone to make sure I understand the pros and cons of @synchronized vs GCD dispatch_barrier_async.
This is the way I see it:
@synchronized
PRO: You can wrap any object in @synchronized as long as you have access/pointer to it, making it easy for shared data models to be safely handled from different objects in the program
PRO: Supported by iOS 4 (and maybe earlier)
`dispatch_barrier_async` with custom DISPATCH_QUEUE_CONCURRENT
PRO: Is faster than @synchronized
CON: DISPATCH_QUEUE_CONCURRENT only available in iOS 5 (as discussed here), so not available for supporting iOS 4
CON: Not as easy to use when controlling read/write on an object from many other objects, since queues are most easily available only to the object that creates them (without some work to go around this limitation)
In summary, the best tool depends on the needs of the program, in consideration of the above.
If anyone has something to add or point out, I'd appreciate it.