Java Concurrency Fundamentals and Implementation Details

Thread States in Java The Thread.State enum defines six states from the Java language perspective: NEW: Thread created but not yet started. RUNNABLE: Thread is executing or ready to run. BLOCKED: Thread is waiting for a monitor lock to enter a synchronized block/method. WAITING: Thread is waiting indefinitely for another thread to perform a pa ...

Posted on Thu, 21 May 2026 22:11:38 +0000 by webmazter

Common Lock Strategies and Synchronized Implementation

Common Lock Strategies Detailed Lock Strategies 1. Pessimistic Lock vs. Optimistic Lock Criteria: When locking, predict whether the probability of lock contention is high or low. If the probability is predicted to be high, more work is required, and locking overhead (time, system resources) is larger → Pessimistic Lock If the probability is pr ...

Posted on Sat, 16 May 2026 00:15:43 +0000 by elenev