Illustrating concurrency
With Mermaid, you can highlight concurrency in a system by showing that multiple state machines are running in parallel. In this section, we will describe how to do this, and you will also learn how to add synchronicity using forks, which show that concurrent state machines start together. We will also cover joins, which show that concurrent state machines end together.
Concurrency
When you model a scenario in a system using a state diagram, it can be the case that one of the states actually has several processes running in parallel. For a state machine, this means that a parent state can be in multiple independent substates at the same time.
We saw an example of this in the previous subsection where the dishwasher we encountered handled both the water level and the water temperature independently when it was washing. Concurrency fits well with this type of scenario where we, instead of trying to combine these two state machines, can place them side...