Tag

rwmutex

0 views collected around this technical thread.

Architecture Development Notes
Architecture Development Notes
Jul 20, 2024 · Backend Development

Master Go Concurrency: Mutex, RWMutex, Cond, Atomic, Once & WaitGroup Explained

This article explores Go's built‑in concurrency primitives—including Mutex, RWMutex, Condition variables, atomic operations, sync.Once, and WaitGroup—detailing their purposes, usage patterns, and best‑practice guidelines to write correct and efficient concurrent programs.

AtomicConcurrencyGo
0 likes · 13 min read
Master Go Concurrency: Mutex, RWMutex, Cond, Atomic, Once & WaitGroup Explained
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.

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

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