I’ve been doing some research on the various approaches to concurrency, and I’ve ended up with the following taxonomy:
- Manual thread based concurrency with locks
- Asynchronous dispatch queues and callbacks as implemented in Apple’s libdispatch (GCD)
- Asynchronous functions, blocking, and message passing as first class language constructs as implemented in Go
- Functional concurrency where immutability makes parallelization near automatic as implemented in Haskell, Clojure, etc.
Obviously this isn’t a ‘pure’ taxonomy (since some elements are built on top of others), but it seems to correspond with the paradigms that people and languages adopt for writing real, useful code (i.e. not academic papers).
Assuming that my list is correct, I’m looking for a grizzled concurrency veteran to give me brief rundown on the pros and cons of each.
For example, most people tend to view threads as hard to manage, but appreciate that they’re a low level construct which can be highly performant if you can afford the dev time. I’m looking for that level of detail on the other 3, and any relevant comparisons between them.