Category Archives: concurrency

java.util.concurrent: Executors, Thread Pools(Cache, Fixed, Scheduled), ExecutorCompletionService – A tutorial

I received a request from one of my blog readers Kunal inquiring if I was planning to post something on FutureTask and ExecutorCompletionService. Since he put the seed of a possible blog post in my mind, I decided to go ahead and write a post on the two concurrency classes. Additionally to make the coverage complete the post intends to cover the Executors class as well.

Continue reading

java.concurrency CyclicBarrier and CountdownLatch: What’s the difference?

I have been researching the Java concurrency classes added as a part of the Java Tiger release. The CyclicBarrier and CountdownLatch classes appeared to achieve the same effect or so to speak provide the same functionality. A bit of further digging revealed the difference.
Continue reading

java.util.concurrent: Java 5 Semaphore

This post is a continuation in the series on Java 5 concurrency utilities. My previous posts dealt with Atomic classes and Locks. This one will focus on the Semaphore class.

Continue reading

java.util.concurrent.locks: Java 5 Concurrency Locks

Before the arrival of Java 5, controlling access to shared data in the JVM memory was straightforward. You just had to channel all concurrent access to the shared data via a synchronized method or synchronized block of code. All this changed with the advent of Java 5. Java 5 unleashed a series of disparate fine grained concurrency utility classes which gave the developer a never before available control over concurrent access. This post will limit itself to focusing on the Lock interface and its implementations.

Continue reading

java.util.concurrent.atomic: How to use Java Atomic Classes? AtomicInteger

It has been some time since the release of Java 5. It introduced a number of improvements in terms of classes to handle concurrency concerns. Today I will cruising thru the java.util.concurrent.atomic package and looking at the package’s relevance in tackling real-life issues.

Continue reading