Almost every Java application uses threads. It is, therefore, necessary to write classes in a thread-safe way, which can be achieved by one of the following techniques: Full Article...
Volatile fields are one of built-in mechanism to write multi-threaded java. In the following I collected three tips on when and how to use volatile fields in practice... Full Article...
The class org.springframework.util.ConcurrentReferenceHashMap which is part of the spring framework is not thread-safe. Full Article...
In the following, I want to show you how to test if your spring application is thread-safe. As an example application, I use the spring petclinic project. Full Article...
In the following, I want to show you an algorithm for a concurrent queue which supports one reading and multiple writing threads. The writing threads need only a read from a thread local field and a write to a volatile field to publish an event to the queue. Full Article...
In the following, I want to show you how to test if your tomcat web application is thread-safe. As an example application, I use Jenkins deployed on an apache tomcat 9.0. Full Article...
In the following, I want to show you a new way to detect deadlocks during tests. A deadlock happens when two threads are trying to acquire a lock held by the other thread. Full Article...
The classes in the package java.util.concurrent use atomic methods to update their internal state in a thread-safe way. In the following, you will see how to write and use such atomic methods to create thread-safe classes. Full Article...
When we update rows in our database we use transactions. By using transactions we can safely modify our data even when multiple clients are accessing the database concurrently. In java, we have many techniques for modifying data concurrently, but we are missing a high-level abstraction like transactions in a database to concurrently modify data in a safe way. Full Article...
java.math.BigDecimal toString is not thread safe. Calling it from multiple threads leads to strange results. Full Article...
© 2020 vmlens Legal Notice Privacy Policy