Atomicity and race conditions
Atomicity is one of the main concerns in concurrent programs. This post shows the effects of executing compound actions in non-synchronized code.
Visibility between threads
Another of the risks of executing code concurrently is how values written by one thread can become visible to other threads accessing the same data.
After looking at the main risks of sharing data, this post describes several class designs that can be shared safely between different threads.
Locking - Intrinsic locks
Intrinsic locks are Java's built-in mechanism for locking in order to ensure that compound actions within a synchronized block are atomic and create a happens-before relationship.
Locking - Explicit locks
Explicit locks provide additional features to the Java synchronization mechanism. Here, we take a look at the main implementations and how they work.