Tagged articles
waitgroup
15 articles · Page 1 of 1
This article dissects the frequent bugs that cause Go worker‑pool implementations to panic, deadlock, or leak goroutines, explains the four core principles for correct channel and WaitGroup usage, showcases five typical error patterns with concrete code, and provides a complete, production‑ready solution.
ConcurrencyGoWorker Pool
0 likes · 14 min read


TonyBaiApr 16, 2026 · Backend Development
The article analyzes how Go’s cheap ‘go’ keyword, while democratizing concurrency, creates fire‑and‑forget pitfalls that lead to resource leaks, deadlocks, and testing headaches, and presents a research‑backed structured‑concurrency discipline defined by four concrete principles, code patterns, and a community library.
ConcurrencyErrGroupGo
0 likes · 16 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

This article explains Go's sync.WaitGroup concurrency primitive, covering its core methods, a classic example, key characteristics, common pitfalls, and best‑practice rules to reliably wait for multiple goroutines to finish before proceeding.
BackendConcurrencygoroutine
0 likes · 9 min read

This article explains Go's lightweight concurrency model, covering Goroutine creation, Channel communication, Select multiplexing, synchronization with WaitGroup and Context, common concurrency patterns such as worker pools and pub/sub, and provides best‑practice recommendations for building high‑performance concurrent programs.
ContextGochannel
0 likes · 7 min read

This article explains why backend developers are moving from PHP to Go, outlines the concurrency challenges of high‑traffic live streaming services, and demonstrates two practical Go patterns—sync.WaitGroup and errgroup.Group—with code examples, while also warning about common closure pitfalls in loops.
ConcurrencyErrGroupGo
0 likes · 9 min read

This article demonstrates how PHP's Swow library executes tasks sequentially versus concurrently using coroutines, compares runtime differences, explains why the main coroutine exits early, and introduces synchronization utilities like waitAll, WaitGroup, and WaitReference with practical code examples.
ConcurrencySynchronizationwaitgroup
0 likes · 12 min read

This article explains why a backend team moved from PHP to Go for high‑concurrency live‑streaming services, compares serial PHP processing with parallel Go execution, and demonstrates two practical Go concurrency patterns—sync.WaitGroup and errgroup—with complete code examples.
BackendErrGroupPHP
0 likes · 8 min read

The article explains why a backend developer moved from PHP to Go, highlights Go’s popularity and simplicity, and demonstrates how Go’s concurrency primitives like sync.WaitGroup and errgroup can transform serial live‑stream data fetching into parallel execution, drastically reducing request latency.
ConcurrencyErrGroupGo
0 likes · 9 min read

Go’s goroutine model lets developers replace complex thread‑pool management with lightweight, runtime‑scheduled functions, enabling simple concurrent execution; this article explains how to launch single or multiple goroutines, synchronize them with WaitGroup, and understand the underlying G‑P‑M scheduler.
GoParallel Programminggoroutine
0 likes · 8 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

The article explains why parallel RPC calls are needed for assembling complex objects, introduces a Go‑based MapReduce framework, walks through concrete code examples for product detail retrieval and UID cleaning, and details the internal architecture—including generate, mapper, reducer, and cancellation mechanisms—while providing full source snippets and execution flow.
ConcurrencyGoMapReduce
0 likes · 10 min read

This article demonstrates how to launch ten concurrent Go tasks using channels and a WaitGroup, capture each task's result and error, handle timeouts and panics, and preserve the original order of results before returning a unified response.
ChannelsConcurrencyTimeout
0 likes · 8 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

Analyzing several major Go projects, the article catalogs frequent concurrency pitfalls—such as unbuffered channels, WaitGroup deadlocks, context leaks, loop‑variable races, double channel closes, timer errors, and RWMutex misuse—and offers concise, idiomatic fixes to prevent blocking, leaks, panics, and deadlocks.
ChannelsConcurrencyContext
0 likes · 10 min read
