12. Concurrency

Overview

In this chapter we will explore Clojure's concurrency features. On the JVM, you will learn the basics of programming with multiple processor threads: starting a new thread and using the results. To coordinate your threads, we will use Clojure's innovative reference types. One of these, the atom, can also be used in a JavaScript environment.

By the end of this chapter, you will be able to build simple browser games and manage their state using atoms.

Introduction

Ever since the Clojure language was first introduced, its concurrency model has been one of its major selling points. In programming, the word "concurrency" can apply to a lot of different situations. To start with a simple definition, any time your program ...

Get The Clojure Workshop 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.