Tagged articles
Mutex
55 articles · Page 1 of 1
This article demonstrates two techniques to prevent multiple instances of a WPF client application: a cross-platform Mutex approach and a .NET Framework-only VB component wrapper that activates the existing window for better UX.
.NET FrameworkC++Mutex
0 likes · 10 min read


TonyBaiOct 5, 2026 · Backend Development
The article traces the 10-year history of Go issue #16620, which sought to make sync.Cond selectable, explains the level-vs-edge-triggered conflict, reviews community workarounds, and details bradfitz's new Mutex.LockChan() demo that enables cancellable locking via select.
ConcurrencyGoGo proposal
0 likes · 14 min read

This article provides a comprehensive deep‑dive into Linux kernel mutex locks, explaining their principles, implementation, and APIs, and demonstrates through detailed C/C++ examples how to use them safely to avoid data races, deadlocks, and performance bottlenecks in multithreaded kernel and user‑space code.
Linux kernelMultithreadingMutex
0 likes · 46 min read

This technical briefing curates ten deep-dive articles covering Linux kernel memory leaks, Transparent Huge Pages latency pitfalls, linked list performance on modern hardware, Android AutoFDO optimization, memory consistency debugging, PageCache internals, DMA-BUF zero-copy architecture, and mutex/futex priority inheritance traps.
Android internalsAutoFDODMA-BUF
0 likes · 6 min read

This comprehensive guide explains why race conditions occur in Linux processes, explores the underlying concepts of critical sections and synchronization, and provides practical examples of atomic operations, mutexes, semaphores, condition variables, read‑write locks, and spinlocks to ensure safe concurrent programming.
C++MutexPOSIX
0 likes · 39 min read

Learn how Go's sync package provides essential concurrency primitives—Mutex, RWMutex, WaitGroup, Once, Cond, and Pool—through clear examples and best‑practice patterns that prevent data races, deadlocks, and performance pitfalls, enabling safe, elegant, and efficient goroutine coordination.
ConcurrencyGoMutex
0 likes · 7 min read

Choosing the right lock—mutex or spinlock—can dramatically affect program performance; this article explains their underlying waiting mechanisms, compares CPU usage, context‑switch costs, and suitability across multi‑core versus single‑core, high‑contention versus low‑contention scenarios, and provides practical C++ code examples.
C++Mutexperformance
0 likes · 29 min read

This tutorial walks through Rust's core smart pointers—Box, RefCell, Rc/Arc, Mutex, and RwLock—showing how to set up the environment, use each pointer with concrete code examples, compare their concurrency behavior, and answer common questions about their proper usage.
ArCBoxMutex
0 likes · 9 min read

Learn why mutexes are essential for safe multithreaded C++ programming, explore the basic std::mutex API, see practical code examples, and discover advanced lock management with std::lock_guard and other mutex types to avoid data races and deadlocks.
C++ConcurrencyMultithreading
0 likes · 9 min read

Learn how Go’s built‑in concurrency model using goroutines and channels can transform sequential code into responsive, high‑performance applications, with clear explanations of concurrency vs parallelism, practical code samples, synchronization techniques, and best practices for building scalable web servers.
ConcurrencyMutexParallelism
0 likes · 10 min read

This article explains what deadlocks are in C++ multithreaded programming, outlines their causes and four necessary conditions, presents common scenarios and code examples, and offers practical strategies such as consistent lock ordering, std::lock, std::scoped_lock, recursive mutexes, and lock hierarchies to avoid them.
C++ConcurrencyLock
0 likes · 20 min read

This article examines frequent mistakes in Go's concurrent programming—such as confusing concurrency with parallelism, assuming concurrency always speeds up execution, misusing channels versus mutexes, overlooking workload types, and misunderstanding contexts—provides detailed explanations, potential impacts, and best‑practice solutions with improved code examples.
ContextGoMutex
0 likes · 27 min read

The article explains the background of the Go mutex performance proposal, details the new spinning flag added to the mutex state, walks through fast‑path, spinning, and sleep phases of lock acquisition, presents benchmark results showing up to 70% speed‑up, and provides references for further reading.
ConcurrencyGoMutex
0 likes · 11 min read

Explore how Rust’s Send and Sync marker traits guarantee thread‑safe ownership transfer and shared references, with clear explanations, practical code examples, custom type implementations, common pitfalls, and performance considerations to help you write reliable concurrent programs.
ArCMutexRust
0 likes · 8 min read

This article explains Go's concurrency model, detailing how goroutines are scheduled on logical processors, how to create and manage them, detect and resolve race conditions using atomic operations, mutexes, and channels, and demonstrates practical code examples for each concept.
BackendMutexatomic
0 likes · 19 min read

The article explains the distinction between a data race—simultaneous unsynchronized memory access by goroutines—and a race condition—logic errors caused by timing dependencies—using Go code examples, demonstrates how to reproduce each issue, and shows how mutexes or atomic operations can resolve them.
ConcurrencyData RaceGo
0 likes · 5 min read

This article walks through Go's concurrency model, detailing how goroutines are scheduled across logical processors, how to control parallelism with GOMAXPROCS, detect and resolve race conditions using atomic operations, mutexes, and channels, and provides practical code examples for each concept.
ChannelsConcurrencyGo
0 likes · 18 min read

This article examines whether std::cout is thread‑safe, explains the concepts of data race and race condition, demonstrates how interleaved output can occur in multithreaded C++ programs, and presents several solutions—including mutexes, custom wrappers, and C++20 std::osyncstream—to ensure orderly output.
C++Data RaceMutex
0 likes · 10 min read

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.
LinuxMutexSemaphore
0 likes · 33 min read

This article explains the treap data structure—its BST and heap properties, random priority balancing, and implementation details—then dives into Go's runtime semaRoot treap, showing step‑by‑step enqueue and dequeue algorithms with code, rotations, and performance reasoning.
ConcurrencyMutexTreap
0 likes · 17 min read

This article explains the design, principles, and C implementations of Linux kernel synchronization primitives—including spinlocks, semaphores, read‑write locks, and mutexes—illustrated with real‑world analogies, code snippets, and usage constraints in interrupt and multi‑CPU contexts.
LinuxMutexSemaphore
0 likes · 22 min read

This comprehensive guide explains the fundamentals of concurrent programming in Go, covering the differences between parallelism and concurrency, process and thread concepts, and detailed usage of goroutines, channels, select statements, timers, mutexes, read‑write locks, wait groups, once, sync.Map, and atomic operations with practical code examples and diagrams.
ConcurrencyMutexParallelism
0 likes · 42 min read

The article explains how to ensure data correctness in Linux inter‑process shared memory communication by using synchronization mechanisms—semaphores, mutexes, and condition variables—providing step‑by‑step code examples for each method and discussing their proper initialization, usage, and potential pitfalls.
C++IPCLinux
0 likes · 15 min read

The article analyses the design of Rust’s Mutex API, compares it with the classic C/POSIX mutex API, explores alternative Rust designs that mimic C, and demonstrates through concrete code examples why Rust’s guard‑based approach preserves safety while a C‑style API would re‑introduce data‑race hazards.
C++ConcurrencyMutex
0 likes · 27 min read

This article provides a comprehensive guide to Go's concurrency model, covering goroutine creation, the scheduler, communication via channels, handling race conditions, and synchronization techniques using atomic operations and mutexes, complete with practical code examples and visual diagrams.
ConcurrencyGoMutex
0 likes · 27 min read

This article investigates why the MySQL show slave status command can hang in a 1‑master‑N‑slave replication setup, analyzes the involved mutex locks through source code inspection, and demonstrates a reproducible debugging scenario using GDB breakpoints and pstack to pinpoint lock contention.
MutexMySQLshow slave status
0 likes · 13 min read

This article explains the classic producer‑consumer synchronization challenge, describes its importance in concurrent programming, and provides two complete C implementations—one using mutexes and condition variables and another using semaphores—along with detailed code and sample output.
C++ConcurrencyMutex
0 likes · 9 min read

This article explains the concept and operation of mutexes, outlines their lock‑unlock workflow, and provides a complete Go example demonstrating how sync.Mutex protects shared data and avoids race conditions in concurrent programs.
GoMutexsync.Mutex
0 likes · 5 min read

This article explains Go's concurrency model, detailing how goroutines are scheduled onto logical processors, how to create and run them, handle race conditions with atomic operations, mutexes, and the race detector, and share data safely using unbuffered and buffered channels with practical code examples.
GoMutexatomic
0 likes · 19 min read

This article examines Go's sync package, detailing how WaitGroup coordinates the completion of multiple goroutines while Mutex protects shared resources, compares their purposes and use cases, and provides practical code examples to help developers choose the right tool for concurrent programming.
ConcurrencyGoMutex
0 likes · 5 min read

This article explains Go's concurrency model, detailing how goroutines are scheduled onto logical processors, how to create and run them, detect and resolve race conditions with atomic operations, mutexes, and channels, and demonstrates buffered versus unbuffered channel communication.
GoMutexRace Detection
0 likes · 18 min read

Learn the core principles of synchronization and mutual exclusion in multi‑process or multi‑threaded Linux environments, explore design concepts such as atomic operations and deadlock avoidance, and see complete POSIX‑thread code examples using semaphores, condition variables, mutexes and spinlocks.
LinuxMultithreadingMutex
0 likes · 8 min read

This article narrates a thread’s life inside an operating system, using vivid analogies and stories to explain processes, thread states, mutexes, semaphores, locking strategies, deadlock scenarios, and best practices for safe concurrent programming in Java.
MutexSemaphoreThread
0 likes · 18 min read

The article systematically explains Linux kernel synchronization primitives—from basic atomic operations through queued spinlocks, counting semaphores, and sleeping mutexes to read‑write semaphores and per‑CPU variants—detailing their underlying data structures, memory‑barrier semantics, and the fast‑path and slow‑path acquisition and release APIs.
Linux kernelMutexSemaphore
0 likes · 13 min read

This article explains essential techniques for managing concurrent access and race conditions in PHP, covering mutex locks, semaphores, atomic operations, queue-based processing, database access optimization, and transaction management to improve system reliability and performance.
ConcurrencyMutexPHP
0 likes · 5 min read

This article demonstrates the problem of unordered file content when multiple Tokio tasks write concurrently in Rust, shows a sample program that exhibits the issue, and provides a solution using Tokio’s asynchronous Mutex to synchronize file access, ensuring ordered and complete writes.
File I/OMutexRust
0 likes · 5 min read

This article explains the various Linux kernel synchronization mechanisms—including inter‑process communication, semaphores, mutexes, message queues, shared memory, and thread pools—detailing how they work, when to use them, and their role in ensuring coordinated execution within the kernel.
IPCLinuxMutex
0 likes · 10 min read

Linux kernel synchronization requires protecting shared mutable state from concurrent access using primitives such as spinlocks, mutexes, read‑write locks, or lock‑less techniques like RCU, which copies data and waits for a grace period, each offering distinct performance, latency, and complexity trade‑offs.
ConcurrencyLinux kernelMutex
0 likes · 26 min read

The article explains Go’s concurrency model, detailing how goroutines are lightweight work units scheduled by the Go runtime onto logical processors, the role of the scheduler, differences between concurrency and parallelism, thread limits, and practical synchronization tools such as WaitGroup, atomic operations, and mutexes.
GoMutexSynchronization
0 likes · 19 min read

The Linux kernel’s mutex is a sleeping lock that serializes access by sleeping threads, enforces strict ownership rules, uses a state flag with a wait list and per‑CPU optimistic spin queue, offers APIs like mutex_init, lock, unlock and trylock, and employs handoff and MCS‑style spinning to improve performance, with OPPO’s team optimizing it to reduce UI jank.
ConcurrencyLinux kernelMutex
0 likes · 16 min read

This article explains the different lock types provided by Go's sync package—including Mutex, RWMutex, Cond, WaitGroup, Once, Map, and Pool—detailing their use cases, code examples, and how they help manage concurrency safely and efficiently.
ConcurrencyMutexPool
0 likes · 14 min read

This article demonstrates a step‑by‑step method for diagnosing MySQL hangs by collecting callstack information, identifying mutex conflicts, and mapping function calls to code locations to pinpoint the root cause of deadlocks.
CallstackHang DiagnosisMutex
0 likes · 4 min read

This session reviews PThread fundamentals and advanced techniques in C, covering thread creation, termination, attributes, mutexes, reader‑writer locks, condition variables, semaphores, barrier synchronization, and thread‑specific data, with code examples and a concluding homework assignment.
MultithreadingMutexSemaphore
0 likes · 11 min read

This article explains the principles of Java's AbstractQueuedSynchronizer (AQS), compares semaphore and monitor mechanisms, analyzes the source code of ReentrantLock, and demonstrates how to create a custom non-reentrant mutex using AQS, with detailed diagrams and code examples.
AQSConcurrencyJava
0 likes · 29 min read

This article explains the core synchronization mechanisms used in modern Linux kernels—including atomic operations, spinlocks, semaphores, and mutexes—detailing their definitions, underlying implementations, API usage, performance characteristics, and appropriate usage scenarios across different execution contexts such as process, interrupt, and soft‑interrupt contexts.
Linux kernelMutexSemaphore
0 likes · 12 min read

This article explores Kotlin/Native's asynchronous concurrency model, detailing the three native approaches—OS‑level threads, Kotlin/Native coroutines, and Workers with object subgraphs—while also examining the preview multithreaded coroutine support, transfer modes, annotations, and practical code examples.
MultithreadingMutexNative
0 likes · 24 min read

This article explains the concept of locks, why they are needed in concurrent programming, and provides an in‑depth look at Go's synchronization primitives—including CAS, atomic operations, spinlocks, semaphores, and the evolution of the sync.Mutex implementation with code examples and performance considerations.
BackendConcurrencyLock
0 likes · 17 min read

This article uses a factory analogy to demystify operating‑system concepts such as processes, threads, mutual‑exclusion locks, and semaphores, illustrating how CPUs, workspaces, workers, and access controls interact to enable concurrent execution while preventing conflicts.
ConcurrencyMutexSemaphore
0 likes · 5 min read

The article analyzes a MySQL 5.6 high‑CPU issue triggered by a frequently executed query with many UID values, identifies mutex contention and excessive memory allocation in InnoDB as root causes, and presents a solution of switching the memory allocator to tcmalloc with configuration changes.
CPUInnoDBMutex
0 likes · 4 min read

This article analyses why a custom Prometheus exporter for Percona MySQL 5.7.23 caused new‑connection failures and query timeouts, reveals a mutex deadlock involving LOCK_global_system_variables, LOCK_log and LOCK_status, and shows that upgrading to MySQL 5.7.25‑28 resolves the issue.
MutexMySQLPercona
0 likes · 10 min read

This article explains what a non‑reentrant function is, why it matters in concurrent Go programs, and demonstrates two practical implementations—using a sync.Mutex and an atomic flag—to ensure a function runs only once at any given time.
ConcurrencyGoMutex
0 likes · 5 min read

A customer’s Oracle 11g RAC experienced chronic high CPU usage; deep AWR analysis revealed that massive parse time was attributed to mutex waits and a hidden hard‑parse failure caused by a missing column, which triggered Bug 16175381 and forced process spin, ultimately resolved by correcting the faulty SQL.
AWRCPUMutex
0 likes · 10 min read

A production MySQL incident showed sudden system CPU spikes and many running threads despite low query throughput, which was traced to the server's time_zone=system setting causing timestamp conversion to lock a global mutex, leading to excessive spin‑locks, context switches, and degraded performance that was resolved by changing the time_zone to a fixed offset.
CPUMutexMySQL
0 likes · 6 min read

This article reviews Python threading fundamentals—including mutex locks and condition variables—explains their interaction, compares threading.Lock with threading.RLock, and presents a concise implementation of a thread‑safe task queue with illustrative diagrams and test code.
ConcurrencyMutexPython
0 likes · 5 min read


ITPUBSep 27, 2016 · Backend Development
This article explains how to implement a memory‑leak detection subsystem for Linux C++ programs by overloading the global new/delete operators, recording allocation sites with file and line information, handling mismatched deletions, supporting dynamic monitoring, and addressing nested‑delete and mutex re‑entrancy issues.
C++DebuggingLinux
0 likes · 30 min read
