Tagged articles
6 articles
Page 1 of 1
Code Wrench
Code Wrench
Oct 11, 2025 · Backend Development

Master Go Concurrency with sync: Mutex, RWMutex, WaitGroup, Once, Cond & Pool

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.

GoOncePool
0 likes · 7 min read
Master Go Concurrency with sync: Mutex, RWMutex, WaitGroup, Once, Cond & Pool
37 Interactive Technology Team
37 Interactive Technology Team
Jun 15, 2023 · Backend Development

Concurrent Safety of Go Maps: Issues, Solutions, and Performance Comparison

Go maps are not safe for concurrent access, so programs can panic when multiple goroutines read and write the same map; to prevent this you can use sync.Once for immutable data, protect maps with sync.RWMutex, employ sharded locks via concurrent‑map, or use the built‑in sync.Map, each offering different performance trade‑offs depending on read/write ratios and concurrency level.

GoMAPRWMutex
0 likes · 13 min read
Concurrent Safety of Go Maps: Issues, Solutions, and Performance Comparison
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.

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