Tag

object lock

0 views collected around this technical thread.

Architecture & Thinking
Architecture & Thinking
Jan 8, 2025 · Fundamentals

Mastering Java’s synchronized: How Object and Class Locks Control Threads

This article explains the purpose and usage of Java’s synchronized keyword, covering object locks, method locks, synchronized blocks, and class locks, along with detailed code examples that demonstrate how threads acquire and release locks to ensure data consistency in multithreaded environments.

ConcurrencyThread Safetyjava
0 likes · 11 min read
Mastering Java’s synchronized: How Object and Class Locks Control Threads
OPPO Kernel Craftsman
OPPO Kernel Craftsman
Mar 3, 2023 · Mobile Development

Understanding Java Object Locks and Their Implementation in the Android Runtime (ART)

The article explains how Java’s synchronized keyword works by describing instance, static and block locks, the monitor‑enter/exit bytecodes, the ART object header’s lock word states (thin, fat, hash, forwarding), lock inflation mechanisms, and the internal runtime functions that implement Object.wait(), notify() and related futex handling.

Android RuntimeConcurrencyJVM
0 likes · 13 min read
Understanding Java Object Locks and Their Implementation in the Android Runtime (ART)
Selected Java Interview Questions
Selected Java Interview Questions
Jul 22, 2020 · Backend Development

Understanding Class Locks and Object Locks in Java with Example Code

This article explains the difference between class locks (static synchronized) and object locks (instance synchronized) in Java, demonstrates their behavior with multithreaded examples, and shows how lock scope affects execution order and synchronization.

ConcurrencyMultithreadingSynchronization
0 likes · 6 min read
Understanding Class Locks and Object Locks in Java with Example Code
Java Captain
Java Captain
Jan 11, 2018 · Fundamentals

Understanding Java's synchronized(this) Object Lock and Thread Interaction

This article explains how Java's synchronized(this) keyword creates an object lock that allows only one thread to execute a synchronized block at a time, demonstrates various scenarios with code examples, and shows how non‑synchronized sections remain concurrent while all synchronized sections on the same object are blocked.

ConcurrencyMultithreadingSynchronization
0 likes · 9 min read
Understanding Java's synchronized(this) Object Lock and Thread Interaction