The changes required for system manage concurrency are only in the commit phase. They involve a reconciliation algorithm that is universal, in the sense that it can be used in any system where data is represented as an immutable hash map. The implementation of the reconciliation algorithm is efficient because subsequent versions of the system state are created via structural sharing.
In the previous chapter, we illustrated the multiversion approach to state management, where a mutation is split into two distinct phases: the calculation phase that deals only with computation, and the commit phase that moves the state reference forward. Usually, in a production system, mutations occur concurrently. Moving the state forward naively like we did in the previous chapter is not appropriate. In the present chapter, we are going to learn how to handle concurrent mutations.