Tag

Thread Synchronization

0 views collected around this technical thread.

Java Captain
Java Captain
Jun 10, 2025 · Fundamentals

Understanding Java Monitors: How Thread Synchronization Works

Java monitors provide a mechanism for thread synchronization by associating each object with a monitor lock, comprising an entry list, owner thread, and wait set, and the article explains their structure, thread state transitions, and demonstrates usage with a practical code example.

ConcurrencyJavaMonitor
0 likes · 6 min read
Understanding Java Monitors: How Thread Synchronization Works
FunTester
FunTester
Jan 9, 2025 · Backend Development

Understanding and Using CountDownLatch in Java Concurrency

This article explains the purpose, basic methods, best‑practice usage, and typical scenarios of Java's CountDownLatch utility, providing code examples and a comparison with Thread.sleep to help developers synchronize multiple threads effectively.

ConcurrencyCountDownLatchJava
0 likes · 9 min read
Understanding and Using CountDownLatch in Java Concurrency
Deepin Linux
Deepin Linux
Nov 27, 2024 · Fundamentals

Linux Thread Synchronization: Mechanisms, Implementations, and Practical Applications

This article provides a comprehensive overview of Linux thread synchronization, explaining core concepts such as mutexes, condition variables, semaphores, and futexes, describing their implementation details, code examples, and common usage scenarios like producer‑consumer and reader‑writer problems.

ConcurrencyCondition VariableFutex
0 likes · 33 min read
Linux Thread Synchronization: Mechanisms, Implementations, and Practical Applications
Deepin Linux
Deepin Linux
Oct 30, 2024 · Fundamentals

An Introduction to POSIX Threads (Pthread) and Their Practical Usage in C/C++

This article provides a comprehensive overview of POSIX threads, covering their architecture, creation, synchronization, attributes, scheduling policies, advantages, drawbacks, and real‑world examples such as mutex protection, barrier synchronization, and a cross‑platform network server implementation.

C ProgrammingLinuxMultithreading
0 likes · 21 min read
An Introduction to POSIX Threads (Pthread) and Their Practical Usage in C/C++
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Aug 19, 2023 · Fundamentals

Java Multithreaded Printing of ABC Sequence Using Semaphores

This article explains how to create three Java threads that print the characters A, B, and C in order, first without synchronization, then using Semaphore for ordered output, and finally extending the solution to repeat the ABC sequence twenty times.

ConcurrencyJavaMultithreading
0 likes · 7 min read
Java Multithreaded Printing of ABC Sequence Using Semaphores
IT Services Circle
IT Services Circle
Jun 27, 2023 · Fundamentals

Using CyclicBarrier for Alternating Thread Printing of ABC in Java

This article explains how to use Java's CyclicBarrier to coordinate three threads that alternately print the characters A, B, and C, providing a detailed analysis, example analogy, complete implementation code, execution result, and a brief summary of its relevance in multithreading interviews.

ConcurrencyCyclicBarrierJava
0 likes · 5 min read
Using CyclicBarrier for Alternating Thread Printing of ABC in Java
ByteDance Terminal Technology
ByteDance Terminal Technology
Nov 23, 2022 · Fundamentals

Understanding and Solving Priority Inversion on iOS

This article analyzes a real‑world iOS deadlock caused by priority inversion when a low‑priority thread holds a read‑write lock, explains bounded and unbounded priority inversion, evaluates priority‑ceiling and priority‑inheritance protocols, and demonstrates practical fixes using QoS adjustments, temporary priority boosts, and appropriate lock choices.

LocksQoSThread Synchronization
0 likes · 26 min read
Understanding and Solving Priority Inversion on iOS
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Sep 27, 2022 · Backend Development

Four Common Ways to Implement Thread Synchronization in Java

This article explains the concept of thread synchronization in Java and provides detailed examples of four implementation methods—using the synchronized keyword, ReentrantLock, atomic variables, and ThreadLocal—along with code snippets and a comparison of their advantages and usage scenarios.

JavaReentrantLockThread Synchronization
0 likes · 6 min read
Four Common Ways to Implement Thread Synchronization in Java
FunTester
FunTester
Dec 25, 2021 · Backend Development

Java Thread Synchronization Utilities: CountDownLatch, CyclicBarrier, and Phaser

An overview of Java’s three primary thread‑synchronization tools—CountDownLatch, CyclicBarrier, and Phaser—explaining their placement in java.util.concurrent, typical use‑cases such as coordinating multi‑threaded tasks in performance testing, and the advantages of each, complemented by illustrative diagrams.

ConcurrencyCountDownLatchCyclicBarrier
0 likes · 7 min read
Java Thread Synchronization Utilities: CountDownLatch, CyclicBarrier, and Phaser
政采云技术
政采云技术
Oct 22, 2021 · Fundamentals

Java Concurrency Tools: CountDownLatch, CyclicBarrier, and Semaphore

This article explains three Java concurrency tools - CountDownLatch, CyclicBarrier, and Semaphore - detailing their mechanisms, source code analysis, and practical usage scenarios with code examples.

AQSCountDownLatchCyclicBarrier
0 likes · 13 min read
Java Concurrency Tools: CountDownLatch, CyclicBarrier, and Semaphore
New Oriental Technology
New Oriental Technology
Jul 15, 2021 · Fundamentals

Synchronized and Lock's Underlying Implementation Analysis

This article analyzes the underlying implementations of Java's synchronized and Lock mechanisms, comparing their differences and exploring the role of AbstractQueuedSynchronizer (AQS) in Lock's functionality.

AQSJava ConcurrencyJava Programming
0 likes · 13 min read
Synchronized and Lock's Underlying Implementation Analysis
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 10, 2021 · Fundamentals

Understanding Java Semaphore: Usage Scenarios, Code Example, and Source‑Code Deep Dive

This article introduces Java's Semaphore as a thread‑synchronization tool, explains its flow‑control use cases such as database connections and parking lots, provides a complete parking‑lot simulation code sample, and analyzes the underlying AQS‑based implementation including fairness, acquire/release mechanics, and auxiliary methods.

AQSConcurrencyJava
0 likes · 13 min read
Understanding Java Semaphore: Usage Scenarios, Code Example, and Source‑Code Deep Dive
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Nov 2, 2020 · Backend Development

Java Multithreaded Sequential Printing: Solutions Using Lock, wait/notify, Condition, Semaphore, and LockSupport

This article presents various Java solutions for common interview multithreading problems that require sequential printing, demonstrating implementations using Lock, wait/notify, Condition, Semaphore, and LockSupport, along with detailed code examples and explanations of thread communication mechanisms.

ConcurrencyJavaLock
0 likes · 15 min read
Java Multithreaded Sequential Printing: Solutions Using Lock, wait/notify, Condition, Semaphore, and LockSupport
vivo Internet Technology
vivo Internet Technology
Mar 22, 2018 · Fundamentals

Understanding Concurrency: Communication, Synchronization, and Java Memory Model

The article explains why Java concurrency is essential, outlines its risks, and details how thread communication and synchronization work, covering the Java Memory Model, the roles of volatile and synchronized for visibility and ordering, and illustrating these concepts with code examples.

ConcurrencyHappen-BeforeJMM
0 likes · 16 min read
Understanding Concurrency: Communication, Synchronization, and Java Memory Model
JD Retail Technology
JD Retail Technology
Nov 29, 2017 · Operations

iOS Thread Synchronization Mechanisms and Lock Implementations

This article explains various iOS thread synchronization tools—including NSLock, NSRecursiveLock, NSConditionLock, NSCondition, @synchronized, dispatch_semaphore, pthread_mutex, and the deprecated OSSpinLock—detailing their internal implementations, usage patterns, code examples, and performance considerations for developers seeking safe concurrent programming on Apple platforms.

ConcurrencyLocksNSLock
0 likes · 22 min read
iOS Thread Synchronization Mechanisms and Lock Implementations
Java Captain
Java Captain
Dec 7, 2016 · Fundamentals

Java Producer‑Consumer Example with Multiple Threads and Synchronization Improvements

This article explains the classic producer‑consumer problem in Java, demonstrates initial implementations using wait/notify with a single producer and consumer, analyzes issues that arise with multiple threads, and presents step‑by‑step code refinements—including while‑loops and notifyAll—to achieve correct multithreaded synchronization.

ConcurrencyJavaMultithreading
0 likes · 9 min read
Java Producer‑Consumer Example with Multiple Threads and Synchronization Improvements
Ctrip Technology
Ctrip Technology
Nov 22, 2016 · Backend Development

Understanding Java Object.wait() and notify() Implementation in the HotSpot JVM

This article explains the internal workings of Java's Object.wait() and notify() methods, detailing how synchronized blocks, monitorenter/monitorexit instructions, the HotSpot ObjectMonitor, wait sets, and entry lists cooperate to manage thread coordination and lock ownership in multithreaded environments.

ConcurrencyHotSpotJVM
0 likes · 10 min read
Understanding Java Object.wait() and notify() Implementation in the HotSpot JVM