September 2016
Intermediate to advanced
408 pages
9h 18m
English
Writing concurrent programs that are correct is hard: subtle race conditions, resources blocked by another thread, asynchronous exceptions, and so on. Basically, a lot can go wrong. Remember that, whereas parallelism points to execution model (multiple threads running simultaneously), concurrency is more like a paradigm: multiple threads working together, intertwined. However, concurrent threads are often run in parallel for responsiveness and performance reasons.
In this chapter, we will write concurrent Haskell programs making use of light-weight threads and type-safe concurrency primitives like MVars. For complex programs, we will learn to build atomic transactions with Software Transactional Memory (
Read now
Unlock full access