Skip to Main Content
The Joy of Clojure, Second Edition
book

The Joy of Clojure, Second Edition

by Michael Fogus, Chris Houser
May 2014
Intermediate to advanced content levelIntermediate to advanced
520 pages
17h 23m
English
Manning Publications
Content preview from The Joy of Clojure, Second Edition

Chapter 10. Mutation and concurrency

This chapter covers

  • Software transactional memory with multiversion concurrency control and snapshot isolation
  • When to use refs
  • When to use agents
  • When to use atoms
  • When to use locks
  • Vars and dynamic binding

Clojure’s main tenet isn’t the facilitation of concurrency. Instead, Clojure at its core is concerned with the sane management of state, and facilitating concurrent programming naturally falls out of that. Concurrency refers to designing systems using independently executing, logic processes (Pike 2012). A simple concurrent design is a single thread named Tom inserting data into a work queue, as shown in figure 10.1.

Figure 10.1. Tom, alone

Of course, although this is technically a concurrent ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Living Clojure

Living Clojure

Carin Meier
Clojure in Action, Second Edition

Clojure in Action, Second Edition

Amit Rathore, Francis Avila
Getting Clojure

Getting Clojure

Russ Olsen
Programming Clojure, 3rd Edition

Programming Clojure, 3rd Edition

Alex Miller, Stuart Halloway, Aaron Bedra

Publisher Resources

ISBN: 9781617291418Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link