Currently, when we test multi-thread Java we call the class under test by as many threads possible. This approach has the disadvantage that most of the time our faulty test succeeds which makes debugging multi-threaded bugs a nightmare. I, therefore, developed an open-source tool, vmlens, to make JUnit test of multi-threaded Java deterministic. Full Article...
Unit-testing multi-threaded Java seams impossible. Bugs depend on the specific timing of the threads and sometimes even on the specific processor type or JVM. But by using byte-code transformations it is possible to test all thread interleavings for a given unit test. I have implemented those transformations in the open-source tool vmlens. Full Article...
ARM CPUs are coming to Java. Amazon offers cloud instances based on ARM-compatible processors. And there is now a new JEP to create an OpenJDK port for Windows on ARM. And Apple plans to use ARM Processors for its Macs and Macbooks. What is the difference between ARM and x86 when we program in Java? Full Article...
The number of current CPUs cores is growing exponentially. Therefore I am looking at the scalability of different data structures. The last time we looked at concurrent queues this time we look at concurrent hash maps. Full Article...
The core count of current CPUs is growing exponentially. So the scalability of concurrent data structures becomes more and more important. Today we look at the scalability of one such data structure: Concurrent Queues. Full Article...
Many concurrent problems can be solved through a concurrent state machine. This leads to better scalability and in my case better memory utilization. I learned this through an OutOfMemoryError exception. And a video from Dr. Cliff Click. Full Article...
The following shows an algorithm for a simple yet scalable concurrent hash map. Full Article...
Thread-safety is typically defined as works correctly even when used by multiple threads. But all those definitions have the disadvantage that they do not tell us how. They do not tell us how the methods behave when called from multiple threads and they do not tell us how to use the methods in a thread-safe way. So I rather define thread-safety as: A class is thread-safe if all its public methods are either atomic or quiescent. Full Article...
Testing multithreading Java seams impossible. Bugs depend on the specific timing and sometimes even on a specific processor type or JVM. But Java has a specification that enables us to test multithreaded software: The Java memory model. Full Article...
The package java.util.concurrent contains two concurrent maps, the class ConcurrentHashMap, and the class ConcurrentSkipListMap. Both classes are thread-safe and high performant. But using them is error-prone because of read modify write race conditions. Here come lambda expressions into the play. Full Article...
Stateless classes are perfect for multi-threaded programming. They can be called from multiple threads without ever worrying about synchronization of their state since there is none. But how can I write a performant, thread-safe stateless service? Full Article...
© 2020 vmlens Legal Notice Privacy Policy