Concurrency issues are among the most annoying and hard to debug ones. Human brains are not wired to reason about concurrency and our intuition about what’s happening in the program is often far from the truth. 

This post offers a simple example of a concurrent Java program to judge how easy is it to misread the semantics of a concurrent program and not foresee it’s behavior.

 

Continue reading to see how to configure  a fuzzy concurrency tests framework, JCStress, write tests with it and use them to prove that your concurrent Java program does what you want it to do