Tag

sync.cond

0 views collected around this technical thread.

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.

ConcurrencyCondition VariableExample
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.

ConcurrencyGoHigh Performance
0 likes · 30 min read
Go High-Performance Programming: Concurrency Optimization Techniques