I am looking for a good online introduction to memory barriers and common errors in Java code:
- Using
synchronized
too often or not often enough - When to use
volatile
and final
- Double check lock
- and etc.
I would be particularly interested in code that shows the behavior and / or examples of solving common problems (for example, creating a map that can be accessed by several threads and where values ββare added lazily).
source share