Software Transactional Memory

Software Transactional Memory (STM) is any method of coordinating multiple concurrent modifications to a shared set of storage locations. Clojure's STM is analogous to a database transaction, but for changes to Clojure's data.

Refs are meant for situations in which multiple threads need to coordinate their changes. Clojure provides a dosync macro for running STM transactions. You will now see this macro in action.