[KongchangAI]
Concept

goroutine

A lightweight concurrent execution unit built into the Go programming language and managed by the Go runtime. Goroutines start with an initial stack of only a few kilobytes that can grow and shrink dynamically, supporting hundreds of thousands of concurrent instances. They form the fundamental building block of Go's concurrency model.

Core Facts

Timeline (last 90 days)

Sep 27

Go provides a set of built-in concurrency primitives through goroutines and channels.

Unverified50%
Sep 27

A goroutine is a lightweight thread managed by the Go runtime, and one can be started simply by adding the go keyword before a function call.

Unverified50%
Sep 27

The Go runtime uses an M:N scheduling model, mapping M goroutines onto N operating system threads for execution.

Unverified50%
Sep 27

The context package provides a standardized mechanism for passing cancellation signals, timeouts, and request-scoped values across goroutines, and can prevent goroutine leaks.

Unverified50%
Sep 12

Go's goroutines are closer to a stackful model and do not use async/await syntax.

Unverified50%
Sep 1

A goroutine is a lightweight coroutine in the Go language with extremely low creation cost (requiring only a few KB of memory), and combined with the channel communication mechanism, it can efficiently manage hundreds or even thousands of concurrent tasks.

Unverified50%
Aug 22

Go运行时内置M:N调度器,自动处理goroutine的抢占式调度与工作窃取,channel提供类型安全的通信机制

Unverified50%

All Facts (10)

Verified

A goroutine's initial stack space is only about 2 KB and can dynamically grow and shrink, allowing a single Go process to run hundreds of thousands of goroutines.

65%
Unverified

cgo调用开销的本质源于Go使用可动态增长的goroutine栈(初始仅2KB),而C函数需要固定大小的系统线程栈

90%
Unverified

The cost of creating a goroutine in Go is only about 2KB of stack space, far lower than the MB-level overhead of operating system threads.

60%
Unverified

The context package provides a standardized mechanism for passing cancellation signals, timeouts, and request-scoped values across goroutines, and can prevent goroutine leaks.

50%
Unverified

Go provides a set of built-in concurrency primitives through goroutines and channels.

50%
Unverified

A goroutine is a lightweight thread managed by the Go runtime, and one can be started simply by adding the go keyword before a function call.

50%
Unverified

The Go runtime uses an M:N scheduling model, mapping M goroutines onto N operating system threads for execution.

50%
Unverified

Go's goroutines are closer to a stackful model and do not use async/await syntax.

50%
Unverified

A goroutine is a lightweight coroutine in the Go language with extremely low creation cost (requiring only a few KB of memory), and combined with the channel communication mechanism, it can efficiently manage hundreds or even thousands of concurrent tasks.

50%
Unverified

Go运行时内置M:N调度器,自动处理goroutine的抢占式调度与工作窃取,channel提供类型安全的通信机制

50%

Source Articles