List/Grid Tag Archives: Concurrency

Invoking Async method call using Future object in Spring
The next example will demonstrate an async method call inside the Spring container. Why do we need async method calls? In some cases we don’t really know if replay is expected or ...

Experiment with ConcurrentHashmap
I am investigating a memory issue in one of my recent projects where data is kept in memory for fast access, but the memory footprint of application is very high. This application was heavily using ...

Five advanced Java Synchronizers you probably don’t know
Besides the common synchronize which is based in the lock bit that every Java object has, you have more sophisticated synchronizers in java, such as:Semaphore – Use the concept ...

Java 8: CompletableFuture in action
After thoroughly exploring CompletableFuture API in Java 8 we are prepared to write a simplistic web crawler. We solved similar problem already using ExecutorCompletionService, Guava ...

Java 8: Definitive guide to CompletableFuture
Java 8 is coming so it’s time to study new features. While Java 7 and Java 6 were rather minor releases, version 8 will be a big step forward. Maybe even too big? Today I will ...

Synchronising Multithreaded Integration Tests revisited
I recently stumbled upon an articleSynchronising Multithreaded Integration Tests on Captain Debug’s Blog. That post emphasizes the problem of designing integration tests involving ...

Why a synchronized StringBuffer was never a good idea
Introduction StringBuffer is a synchronized class for mutable strings. The main problem with making it synchronized is thatIt was usually used as a local variable so making it synchronized ...

Inadvertent Recursion Protection with Java ThreadLocals
Now here’s a little trick for those of you hacking around with third-party tools, trying to extend them without fully understanding them (yet!). Assume the following situation:You ...

Detecting Java Threads in Deadlock with Groovy and JMX
Unfortunately, Java applications taking advantage of multiple threads can at times run into the dreaded deadlock condition. Fortunately, the Java Platform makes deadlock detection relatively ...

Advanced ListenableFuture capabilities
Last time we familiarized ourselves with ListenableFuture. I promised to introduced more advanced techniques, namely transformations and chaining. Let’s start from something straightforward. ...


