Koskamo

Concurrency with goroutines and channels

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

Go encourages passing shared values around on channels rather than actively sharing memory between separate threads of execution, so only one goroutine has access to a value at any given time and data races cannot occur by design — captured in the slogan "Do not communicate by sharing memory; instead, share memory by communicating." Mutexes remain suitable for cases like reference counts. Goroutines are lightweight functions executing concurrently in the same address space; their stacks start small and grow via heap allocation, and they are multiplexed onto multiple OS threads so others keep running if one blocks on I/O. Prefixing a call with the go keyword runs it in a new goroutine, which exits silently when the call completes, and function literals act as closures that keep referenced variables alive. Go's approach originates in Hoare's CSP and can be seen as a type-safe generalization of Unix pipes. Scope: Go. Reviewed October 4, 2026.

Source and provenance

Original source
go.dev
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.