Happens-Before In Java, Write a Thread-Safe App

Multithreading is the most complex part of Java. Happens-before is a relation that gives a guarantee of allowing the writing of predictable code in multithreading a reality. Such code is also known as thread-safe code. Unfortunately, the Oracle Java documentation about this notion is hard to read. So in this article, I’ll mainly explain what … Read more

Visualizing Thread-Safe Singletons in Java

Working in Java, we seldom have to create our handwritten singletons, for the existing frameworks like Spring creates these objects for us and maintains them. In enterprise applications, we get into framework disposal and let them create the singletons. But it is interesting to know the singleton pattern and visualize the famous pattern in a … Read more