Tagged articles
38 articles
Page 1 of 1
Deepin Linux
Deepin Linux
May 10, 2026 · Fundamentals

Do You Really Understand pthread Internals? Master Linux Multithreading Basics

This article dives deep into Linux pthread fundamentals, covering process‑vs‑thread concepts, the POSIX API, kernel implementation via the clone syscall, thread lifecycle, synchronization primitives, common pitfalls such as deadlocks, stack overflows and thread leaks, and provides practical debugging and mitigation techniques with real code examples.

Linuxclone syscalldeadlock
0 likes · 55 min read
Do You Really Understand pthread Internals? Master Linux Multithreading Basics
Liangxu Linux
Liangxu Linux
Nov 16, 2025 · Fundamentals

Mastering pthread Condition Variables: Efficient Thread Wait‑Notify in Linux

This article explains the core principles, API usage, and best‑practice steps for pthread condition variables in embedded Linux, showing why they must be paired with mutexes, how to avoid lost wake‑ups, when to use signal versus broadcast, and includes a complete C example with practical tips.

c-programmingcondition variablepthread
0 likes · 9 min read
Mastering pthread Condition Variables: Efficient Thread Wait‑Notify in Linux
Tech Freedom Circle
Tech Freedom Circle
Jul 8, 2025 · Backend Development

How to Diagnose and Prevent Java Deadlocks (Alibaba & Other Big‑Company Interviews)

This article explains what a deadlock is, the four necessary conditions that cause it, demonstrates classic synchronized‑based and Lock‑based deadlock examples in Java, shows how to detect deadlocks with tools such as Arthas, jstack, jvisualvm and JMC, and provides practical strategies—including lock ordering, timeout locks, and two‑phase locking—to break each condition and avoid deadlocks in production code.

ArthasJavaLock
0 likes · 24 min read
How to Diagnose and Prevent Java Deadlocks (Alibaba & Other Big‑Company Interviews)
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.

JavaMonitorSynchronization
0 likes · 6 min read
Understanding Java Monitors: How Thread Synchronization Works
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Jan 10, 2025 · Backend Development

Mastering CountDownLatch and CyclicBarrier: Java Concurrency Made Simple

CountDownLatch and CyclicBarrier are two essential Java synchronization tools from java.util.concurrent, enabling threads to coordinate tasks; this guide explains their concepts, usage with code examples, advantages, disadvantages, and key differences, helping developers choose the right tool for thread coordination.

CountDownLatchCyclicBarrierJava
0 likes · 10 min read
Mastering CountDownLatch and CyclicBarrier: Java Concurrency Made Simple
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.

Backend DevelopmentCountDownLatchJava
0 likes · 9 min read
Understanding and Using CountDownLatch in Java Concurrency
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.

CyclicBarrierJavaconcurrency
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.

LocksQoSiOS
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.

ReentrantLockThreadLocalatomic
0 likes · 6 min read
Four Common Ways to Implement Thread Synchronization in Java
Senior Brother's Insights
Senior Brother's Insights
May 24, 2022 · Fundamentals

Why Does Thread A Always Grab the Lock First? A Deep Dive into Java Synchronization, JVM Internals, and CPU Fundamentals

This article explores the evolution from early mechanical calculators to modern CPUs, explains thread states, synchronization mechanisms, memory barriers, volatile semantics, and JVM lock implementations, and reveals why Java's notify method consistently awakens a specific waiting thread.

CASCPU architectureJVM internals
0 likes · 39 min read
Why Does Thread A Always Grab the Lock First? A Deep Dive into Java Synchronization, JVM Internals, and CPU Fundamentals
Ziru Technology
Ziru Technology
Mar 15, 2022 · Backend Development

Unlocking Java Concurrency: How CountDownLatch Works Inside JDK 1.8

This article explores the inner workings of Java’s CountDownLatch from JDK 1.8, detailing its core concepts such as the counter, thread synchronization, shared mode, and AQS mechanisms, and demonstrates practical usage through step‑by‑step code analysis and examples.

AQSBackend DevelopmentCountDownLatch
0 likes · 5 min read
Unlocking Java Concurrency: How CountDownLatch Works Inside JDK 1.8
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.

CountDownLatchCyclicBarrierJava
0 likes · 7 min read
Java Thread Synchronization Utilities: CountDownLatch, CyclicBarrier, and Phaser
ITPUB
ITPUB
Dec 23, 2021 · Fundamentals

Understanding Deadlocks: Causes, Conditions, and Prevention Strategies

The article provides a comprehensive overview of deadlocks, explaining what they are, the resources and ordering issues that cause them, the four necessary conditions, and detailed prevention, detection, and recovery techniques including lock ordering, timeout strategies, and the banker’s algorithm.

Javaconcurrencyresource allocation
0 likes · 11 min read
Understanding Deadlocks: Causes, Conditions, and Prevention Strategies
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.

AQSFairnessJava
0 likes · 13 min read
Understanding Java Semaphore: Usage Scenarios, Code Example, and Source‑Code Deep Dive
JavaEdge
JavaEdge
Apr 29, 2021 · Interview Experience

Mastering Java Semaphore: How init, down, and up Ensure Thread Safety

This article explains the semaphore model, its three core operations (init, down, up), how they manage counters and waiting queues, and demonstrates proper usage in Java to achieve mutual exclusion and resource limiting, complete with code examples and visual diagrams.

Backend DevelopmentJavainterview
0 likes · 6 min read
Mastering Java Semaphore: How init, down, and up Ensure Thread Safety
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.

JavaLockconcurrency
0 likes · 15 min read
Java Multithreaded Sequential Printing: Solutions Using Lock, wait/notify, Condition, Semaphore, and LockSupport
Code Ape Tech Column
Code Ape Tech Column
Aug 22, 2020 · Fundamentals

How ReentrantLock Works Under the Hood: A Deep Dive into Java’s AQS

This article breaks down the inner workings of Java’s ReentrantLock, explaining spin locks, the role of AbstractQueuedSynchronizer, fair vs. non‑fair locking, and step‑by‑step thread execution with code examples and diagrams to illustrate the complete lock acquisition and release process.

AQSJavaLock
0 likes · 17 min read
How ReentrantLock Works Under the Hood: A Deep Dive into Java’s AQS
FunTester
FunTester
Aug 3, 2020 · Backend Development

Mastering Java’s CyclicBarrier: Synchronize Threads with Ease

This article explains Java’s CyclicBarrier synchronization barrier introduced in JDK 1.5, detailing its constructors, key methods such as await() and reset(), usage patterns for coordinating multiple threads in performance testing, and provides a complete demo with code examples and practical tips for handling timeouts and exceptions.

CyclicBarrierJDK1.5Java
0 likes · 7 min read
Mastering Java’s CyclicBarrier: Synchronize Threads with Ease
Java Backend Technology
Java Backend Technology
Sep 15, 2019 · Backend Development

8 Ways to Enforce Thread Order in Java: From join to Semaphore

This article explores eight Java concurrency techniques—including join, main‑thread join, wait/notify, thread pools, Condition, CountDownLatch, CyclicBarrier, and Semaphore—to achieve sequential thread execution, complete with code examples and sample outputs for each method.

Javaconcurrencysemaphore
0 likes · 22 min read
8 Ways to Enforce Thread Order in Java: From join to Semaphore
Meituan Technology Team
Meituan Technology Team
Nov 15, 2018 · Backend Development

Understanding Java Locks: Optimistic, Pessimistic, CAS, and Various Lock Types

The article explains Java’s various lock mechanisms—including optimistic vs. pessimistic, spin and adaptive spin, no‑lock through heavyweight states, fair vs. unfair, reentrant vs. non‑reentrant, and exclusive vs. shared locks—using JDK 8 source code and practical examples to guide developers in choosing the appropriate lock for different concurrency scenarios.

CASJavaLocks
0 likes · 26 min read
Understanding Java Locks: Optimistic, Pessimistic, CAS, and Various Lock Types
Programmer DD
Programmer DD
Jul 1, 2018 · Backend Development

Mastering Java’s CyclicBarrier: How Threads Synchronize and What Can Go Wrong

This article explains Java’s CyclicBarrier synchronization aid, detailing its purpose, constructors, the await() workflow, internal implementation with ReentrantLock and Condition, generation handling, error scenarios, timeout support, and provides a complete multithreaded example illustrating its practical use.

CyclicBarrierJavaconcurrency
0 likes · 10 min read
Mastering Java’s CyclicBarrier: How Threads Synchronize and What Can Go Wrong
ITPUB
ITPUB
Jun 19, 2018 · Fundamentals

Understanding Linux Processes, Zombie Processes, and Multithreading

This article explains what a Linux process is, how the kernel schedules multiple processes, the nature and dangers of zombie processes, techniques to prevent them, and the fundamentals of multithreading, including thread creation, scheduling, priorities, and synchronization issues.

LinuxOperating Systemprocess management
0 likes · 14 min read
Understanding Linux Processes, Zombie Processes, and Multithreading
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.

LocksNSLockconcurrency
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.

Producer ConsumernotifyAllthread synchronization
0 likes · 9 min read
Java Producer‑Consumer Example with Multiple Threads and Synchronization Improvements