Tag

goroutine

1 views collected around this technical thread.

php中文网 Courses
php中文网 Courses
Jun 3, 2025 · Backend Development

Understanding Go's Concurrency Model: Goroutine, Channel, Select, WaitGroup, and Context

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.

ConcurrencyContextGo
0 likes · 7 min read
Understanding Go's Concurrency Model: Goroutine, Channel, Select, WaitGroup, and Context
Raymond Ops
Raymond Ops
May 8, 2025 · Backend Development

Mastering Go Concurrency: Goroutines, Channels, and Synchronization Explained

This article provides a comprehensive guide to Go's concurrency model, covering goroutine creation, the scheduler, synchronization primitives such as WaitGroup, atomic operations, mutexes, and both unbuffered and buffered channels, with practical code examples and explanations of race conditions and best practices.

ChannelsConcurrencyGo
0 likes · 25 min read
Mastering Go Concurrency: Goroutines, Channels, and Synchronization Explained
FunTester
FunTester
Mar 26, 2025 · Backend Development

Common Go Concurrency Errors and Best Practices

This article examines frequent mistakes in Go's concurrent programming—such as confusing concurrency with parallelism, assuming concurrency always speeds up execution, misusing channels versus mutexes, overlooking workload types, and misunderstanding contexts—provides detailed explanations, potential impacts, and best‑practice solutions with improved code examples.

ConcurrencyContextGo
0 likes · 27 min read
Common Go Concurrency Errors and Best Practices
Raymond Ops
Raymond Ops
Jan 25, 2025 · Backend Development

Master Go Concurrency: Goroutines, Scheduler, and Synchronization Techniques

This article explains Go's concurrency model, detailing how goroutines are scheduled on logical processors, how to create and manage them, detect and resolve race conditions using atomic operations, mutexes, and channels, and demonstrates practical code examples for each concept.

AtomicConcurrencyGo
0 likes · 19 min read
Master Go Concurrency: Goroutines, Scheduler, and Synchronization Techniques
Raymond Ops
Raymond Ops
Jan 9, 2025 · Backend Development

Master Go Concurrency: Goroutines, Scheduler, Race Detection, and Channels Explained

This article walks through Go's concurrency model, detailing how goroutines are scheduled across logical processors, how to control parallelism with GOMAXPROCS, detect and resolve race conditions using atomic operations, mutexes, and channels, and provides practical code examples for each concept.

AtomicChannelsConcurrency
0 likes · 18 min read
Master Go Concurrency: Goroutines, Scheduler, Race Detection, and Channels Explained
Raymond Ops
Raymond Ops
Jan 7, 2025 · Backend Development

Mastering Go’s Context: Control Goroutine Lifecycles and Cancel Operations

This article explains Go's Context concept, its role in managing Goroutine lifecycles, the standard library's context package API, how to create and cancel contexts, share values safely, and best practices for using Contexts in concurrent backend applications.

Backend DevelopmentConcurrencyContext
0 likes · 11 min read
Mastering Go’s Context: Control Goroutine Lifecycles and Cancel Operations
Raymond Ops
Raymond Ops
Jan 4, 2025 · Backend Development

Why This Simple Go Program Deadlocks: The Hidden Goroutine Trap

The article explains why a seemingly straightforward Go program that creates an unbuffered channel, launches a goroutine to print a received value, and then sends a value deadlocks, analyzes the evaluation order of go statements, and shows how to fix the issue by moving the receive into a separate goroutine.

ConcurrencyGochannel
0 likes · 7 min read
Why This Simple Go Program Deadlocks: The Hidden Goroutine Trap
Tencent Cloud Developer
Tencent Cloud Developer
Nov 5, 2024 · Backend Development

Understanding and Optimizing Go Performance with pprof and trace Tools

The article teaches Go developers how to generate and analyze CPU, heap, allocation, and goroutine profiles with pprof and full‑runtime traces, interpret SVG flame‑graphs, top lists, and source views, and apply concrete optimizations—such as buffering channels and using sync.Pool—to dramatically speed up a Mandelbrot generator.

GoOptimizationPerformance Profiling
0 likes · 58 min read
Understanding and Optimizing Go Performance with pprof and trace Tools
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
Bilibili Tech
Bilibili Tech
Sep 8, 2023 · Backend Development

Investigation of Goroutine Leak in Go

The article details how a sudden surge in goroutine and heap usage was traced to repeatedly creating gRPC clients instead of reusing a singleton, leading to blocked goroutines and TCP connections, and explains using pprof, stack traces, and tools like goleak to detect and prevent such leaks.

GoMemory LeakPerformance Tuning
0 likes · 13 min read
Investigation of Goroutine Leak in Go
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Mar 2, 2023 · Backend Development

Understanding Go's Goroutine Scheduler and the GMP Model

This article explains how Go implements its own goroutine scheduler within the runtime, demonstrates it with sample code, and details the GMP (Goroutine‑M‑Processor) model, its scheduling strategies, and the evolution from the earlier GM model.

ConcurrencyGMPGo
0 likes · 8 min read
Understanding Go's Goroutine Scheduler and the GMP Model
Tencent Cloud Developer
Tencent Cloud Developer
Nov 28, 2022 · Backend Development

Understanding Go Channels: Implementation, Usage, and Performance

The article explains Go’s channel implementation as a lock‑protected FIFO queue composed of a circular buffer, send and receive wait queues, detailing creation, send/receive mechanics, closing behavior, a real‑world memory‑leak example, and why this design offers safe, performant concurrency comparable to mutexes.

ConcurrencyGoMemory Leak
0 likes · 29 min read
Understanding Go Channels: Implementation, Usage, and Performance
Tencent Cloud Developer
Tencent Cloud Developer
Sep 14, 2022 · Backend Development

Understanding Go Stack Memory Management

The article explains how Go’s runtime manages goroutine stacks—starting with a 2 KB initial size, evolving from segmented to continuous stacks, detailing allocation via stackpool and stackLarge, expansion with runtime.newstack, shrinkage by the garbage collector, and the internal structures that coordinate these processes.

ConcurrencyGoMemory Management
0 likes · 15 min read
Understanding Go Stack Memory Management
Efficient Ops
Efficient Ops
Aug 9, 2022 · Operations

Why Did kube-apiserver OOM? A Deep Dive into Kubernetes Control-Plane Failures

This article analyzes a September 2021 incident where a Kubernetes cluster’s kube-apiserver repeatedly OOM-killed, causing kubectl hangs, by examining cluster specs, monitoring data, logs, heap and goroutine profiles, and the DeleteCollection implementation, ultimately offering troubleshooting steps and preventive measures for control-plane stability.

Cloud NativeKubernetesTroubleshooting
0 likes · 20 min read
Why Did kube-apiserver OOM? A Deep Dive into Kubernetes Control-Plane Failures
Tencent Cloud Developer
Tencent Cloud Developer
Jul 25, 2022 · Backend Development

Understanding Go Concurrency: Goroutines, Scheduler, Threads and Synchronization

The article explains Go’s concurrency model, detailing how goroutines are lightweight work units scheduled by the Go runtime onto logical processors, the role of the scheduler, differences between concurrency and parallelism, thread limits, and practical synchronization tools such as WaitGroup, atomic operations, and mutexes.

AtomicConcurrencyGo
0 likes · 19 min read
Understanding Go Concurrency: Goroutines, Scheduler, Threads and Synchronization
IT Services Circle
IT Services Circle
Mar 30, 2022 · Backend Development

Deep Dive into Golang net Package: Internal Mechanics of Listen, Accept, Read and Write

This article explains how Go's net package implements network operations—showing a simple server example, then dissecting the internal workflow of Listen, Accept, Read and Write, including socket creation, epoll integration, coroutine blocking and wake‑up mechanisms.

.NETConcurrencyepoll
0 likes · 18 min read
Deep Dive into Golang net Package: Internal Mechanics of Listen, Accept, Read and Write
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.

BenchmarkConcurrencyGo
0 likes · 30 min read
Go High-Performance Programming: Concurrency Optimization Techniques
High Availability Architecture
High Availability Architecture
Mar 24, 2022 · Backend Development

Understanding Go's Goroutine Scheduling: Design Principles, GMP Model, and Optimizations

The article reviews Dmitry Vyukov's 2019 talk on Go's goroutine scheduler, explains the GMP (goroutine‑M‑Processor) model, walks through its evolution from naive thread‑per‑goroutine to thread pools and work‑stealing, and discusses fairness, pre‑emptive scheduling, and possible future improvements.

ConcurrencyGMP modelGo
0 likes · 14 min read
Understanding Go's Goroutine Scheduling: Design Principles, GMP Model, and Optimizations
Tencent Cloud Developer
Tencent Cloud Developer
Mar 17, 2022 · Fundamentals

Understanding Go's Goroutine Scheduler: Design, GMP Model, and Optimizations

The article explains Go’s GMP‑based goroutine scheduler, detailing how logical processors, thread‑local queues, and work‑stealing replace a naïve one‑goroutine‑per‑thread model, and discusses fairness, cooperative preemption, current limitations, and future optimizations compared with custom coroutine frameworks.

ConcurrencyGMP modelGo
0 likes · 14 min read
Understanding Go's Goroutine Scheduler: Design, GMP Model, and Optimizations