16 Concurrency
This chapter covers
- Running computations concurrently
- Synchronizing threads with mutable variables and channels
- Using software transactional memory
Almost every server or desktop application nowadays runs concurrently over many CPU cores. Once the result of a limitation on increasing single-processor speed, this becomes an opportunity to organize our applications in new ways. An application becomes a collection of tasks that run in dedicated threads. For multithreading, we can use either operating system threads or library threads. The latter are lightweight, so we can run many of them. Threads work concurrently, so we need to synchronize them.
In this chapter, we’ll discuss Haskell approaches to develop concurrent applications ...
Get Haskell in Depth now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.