Browse Clojure Foundations for Java Developers

Concurrency Utilities

Quick reference for Clojure’s state and async tools: atoms/refs/agents plus futures/promises and related utilities.

Concurrency in Clojure starts with immutable values, then adds a small set of explicit tools for “change over time.” That is different from the Java habit of mutating objects and protecting them with locks.

Use this section as a quick refresher on when to reach for atoms, refs, agents, futures, and related utilities—especially when you are reviewing concurrent code and want to sanity-check its shape.

In this section

  • Atoms
    Atoms are Clojure’s go-to for synchronous, independent state: atomic updates with swap! and reset! (think AtomicReference).
  • Refs and Transactions
    Refs use Software Transactional Memory (STM) for coordinated, synchronous updates to multiple pieces of shared state.
  • Agents
    Agents manage asynchronous, independent state changes: queue actions with send/send-off and handle failures explicitly.
  • Futures and Promises
    Simple async tools on the JVM: futures run a computation; promises are one-time values you deliver later (both deref with @).
Revised on Friday, April 24, 2026