Java concurrency articles

on waitingforcode.com

LockSupport in Java

During reading Thread documentation I found a class that existence I've ignored until now - LockSupport. Some of its methods influence Thread states, so it was quite natural choice for the topic of next posts. Continue Reading →

OS Thread Scheduler and Java Thread

Most of time threads manipulation is limited to programming language. Even if this high abstraction is sufficient, it's also good to know what happens under-the-hood when a new thread is created in any programming language (Java in the case of this post). Continue Reading →

Handling InterruptedException

The risk of InterruptedException appears very often in multi-threading environment. As a declared exception, it must be defined either in method signature or caught in try-catch block. However, it must be done in some correct way. Continue Reading →

TransferQueue

Often consumer-producer applications stores common elements in shared queue. Java offers different types of this data structure and one of them is TransferQueue. Continue Reading →

Completable future

With Java 8 comes a complementary class to classical Future objects. This class not only helps to work with promises but also makes possible to get future results in non-blocking way. Continue Reading →

Atomic package

Atomicity in thread-safe parallel programming is one of crucial points. Thanks to it, any thread participating in the parallel code execution receives the final value, without the risk to get an "intermediate" value modified by another thread. Continue Reading →

CountedCompleter

Java 8 brings another type of ForkJoinTask, CountedCompleter. And because sometimes this class is considered little bit obscure, we'll try to understand it through this article. Continue Reading →

Barriers in Java concurrency

A barrier in the real world helps to separate two different concepts, for example two countries. In programming, it's a technique to achieve threads synchronization. Java implements its own version of barriers in java.util.concurrent package. Continue Reading →

Objects locking

Synchronized blocks are only one of methods to handle concurrent access to Java's objects. Another one are the implementation of classes included in java.util.concurrent.locks package. Continue Reading →

Object monitor pattern

Classes synchronization in Java multi-threading environment can be done thanks to many classes from java.util.concurrent package. But it can also be achieved thanks to some traditional methods, as monitors. Continue Reading →

Future in Java

Concurrent programming isn't not only about executing several tasks in parallel threads. It's only about analyzing results of these process. In Java, we can analyze them thanks to the idea of futures. Continue Reading →

Executor services in Java

Java 1.5 introduced a concept of executors, very useful for concurrent environments. Thanks to them we can easily create thread pools and even manipulate results generated by the threads. This article will cover this subject. Continue Reading →

CountDownLatch in Java

Java's version 1.5 introduced more of features to help to deal with multi-threading programs. One of these features is a class which allows a main thread to wait another threads before continue. The name of this class is CountDownLatch. Continue Reading →