Next article in the series: now that you know about the dangerous/complicated primitives, don't ever touch them again. Instead use the high-level safe concurrency/parallelism mechanisms in your programming language: futures/promises, nurseries, channels, observers, actors, monitors. Ideally, these should be built-in, but a library whose API composes well into most programs will also do.<p>Data races can be statically removed by carefully restricting certain parts of the language design, see Pony. <a href="https://tutorial.ponylang.io/#what-s-pony-anyway" rel="nofollow">https://tutorial.ponylang.io/#what-s-pony-anyway</a><p>Bonus: learn aspects of deadlocking by playing a game: <a href="https://deadlockempire.github.io/" rel="nofollow">https://deadlockempire.github.io/</a>