Browse by Topic

Popular

Latest

Latest Java Posts

Editorial illustration of a Java thread pool with worker threads processing tasks from a bounded queue and a rejection handler.
Java

Java Thread Pool: How Executors Behave Under Load

How Java thread pools behave under load: queue types, rejection policies, shutdown patterns, and production tuning for ThreadPoolExecutor.

ThreadPoolExecutorExecutorServiceConcurrencyMultithreading
Illustration of a Java executor thread pool routing tasks to worker threads.
Java

Java Executors: Thread Pools and Task Lifecycles

How the Java Executor framework manages thread pools, task submission, shutdown, and error handling, plus guidance on choosing the right executor.

ThreadPoolExecutorExecutorServiceConcurrencyFuture
Diagram of Java ExecutorService managing a thread pool with tasks being submitted and executed.
Java

Java ExecutorService: Managing Thread Pools in Practice

Learn how to use Java ExecutorService to manage thread pools, submit tasks, collect results, and shut down cleanly in production code.

JavaExecutorServiceThread PoolsConcurrency
Illustration of multiple threads meeting at a cyclic barrier in Java
Java

Java CyclicBarrier: Synchronize Parallel Tasks

Learn how to use Java CyclicBarrier to coordinate parallel threads, handle broken-barrier failures, and choose between CyclicBarrier and CountDownLatch.

CyclicBarrierJava concurrencyMultithreadingSynchronization
Diagram showing multiple worker threads waiting at a latch while a coordinating thread counts down to release them.
Java

Java CountDownLatch: Coordinating Concurrent Tasks

Learn how to use Java CountDownLatch to coordinate threads, handle timeouts, and avoid common pitfalls in concurrent Java code.

Java concurrencyCountDownLatchmultithreadingthread coordination
Illustration of a Java semaphore controlling access to a shared resource with multiple threads waiting for permits.
Java

Using Semaphore in Java for Concurrency Control

Learn how to use java.util.concurrent.Semaphore to control access to shared resources, handle fairness, avoid common pitfalls, and choose the right synchronization primitive.

concurrencythread-safetysynchronizationmultithreading
Illustration of the Java Condition interface coordinating two threads with a lock and await/signal operations.
Java

Using the Java Condition Interface for Thread Coordination

Learn how to use the Java Condition interface with Lock to coordinate threads, including await, signal, and signalAll, a producer-consumer example, and key differences from Object wait/notify.

JavaConcurrencyLockCondition
Illustration comparing Java synchronized keyword and Lock API with a scale balancing two concurrency mechanisms
Java

Java synchronized vs Lock: Key Differences

java synchronized vs lock: Compare Java synchronized and Lock APIs: syntax, features, fairness, interruption, and performance tradeoffs to choose the right concurrency...

concurrencymultithreadinglockssynchronization
A visual metaphor of a lock with multiple keys representing reentrant locking in Java concurrency.
Java

Java ReentrantLock: Locking with More Control

Java ReentrantLock provides reentrant locking, fairness control, timed and interruptible acquisition, and Condition variables for more flexible concurrency than the synchronized keyword.

ReentrantLockJava ConcurrencyLockingMultithreading
Java Lock interface concept with a padlock and multiple threads waiting, representing concurrency control
Java

Java Lock Interface: Flexible Concurrency Control

Understand the java lock interface, its methods, and how to use ReentrantLock for advanced concurrency control beyond synchronized.

Java ConcurrencyLock InterfaceReentrantLockSynchronization