O'Reilly logo

Functional Programming: A PragPub Anthology by Michael Swaine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9Concurrent Programming in Clojure

by Michael Bevilacqua-Linn

In the previous chapter, we learned about Clojure’s take on value, state, and identity. In this chapter, we’ll take things a bit further and see how Clojure’s philosophy makes it ideal for concurrent programming. As we do so, we’ll take a closer look at Clojure’s managed references—atoms, agents, and refs—as well as the software transactional memory system they work with.

A concurrent program is one where multiple processes, or threads, may be run in parallel. The main difficulty with concurrent programming is coordinating access to shared resources. As we’ll see, this can have strange effects even in seemingly simple situations.

Let’s start off with a look at a simple ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required