Tagged articles

sync.Cond

4 articles · Page 1 of 1
TonyBai
TonyBai
Oct 5, 2026 · Backend Development

Go's 10-Year Select Proposal Revived: bradfitz's Mutex.LockChan() Demo

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.

GoGo proposalLockChan
0 likes · 14 min read
Go's 10-Year Select Proposal Revived: bradfitz's Mutex.LockChan() Demo
Go Programming World
Go Programming World
Dec 30, 2024 · Backend Development

Understanding and Using sync.Cond in Go: Source Code Analysis and Practical Examples

This article explains the purpose, internal implementation, and correct usage patterns of Go's sync.Cond concurrency primitive, walks through its source code, demonstrates simple and advanced examples—including a custom concurrent waiting queue—and provides test cases to illustrate its behavior in real-world scenarios.

Queueconcurrencycondition variable
0 likes · 20 min read
Understanding and Using sync.Cond in Go: Source Code Analysis and Practical Examples
Tencent Cloud Developer
Tencent Cloud Developer
Mar 30, 2022 · Backend Development

Go High-Performance Programming: Concurrency Optimization Techniques

This article, the second in a Go high‑performance series, details concurrency optimizations including lock‑free data structures versus locked lists, sharding and RWMutex to cut lock contention, controlling goroutine creation with pooling, using sync.Once for cheap one‑time initialization, and employing sync.Cond for efficient goroutine notification.

GoHigh PerformanceLock-Free
0 likes · 30 min read
Go High-Performance Programming: Concurrency Optimization Techniques