← All notes

Go goroutines: lightweight concurrent functions

Answer: A goroutine is a function executing concurrently with other goroutines in the same address space. Prefix a function or method call with the go keyword to start one. Concurrency is not parallelism.

The goroutine model

Effective Go gives a simple model: the goroutine is a function executing concurrently with other goroutines, all in one address space.

The cost is little more than allocating stack space. Stacks start small and grow later as required.

The runtime multiplexes goroutines onto multiple OS threads. If one blocks, for example on I/O, others continue to run.

Prefix a function or method call with the go keyword to start that call in a new goroutine. When the call completes, the goroutine exits silently.

Concurrency versus parallelism

No introduction to Go is complete without a demonstration of its goroutines and channels.

In programming, concurrency is the composition of independently executing processes. Parallelism is the simultaneous execution of computations.

One way to phrase the contrast: concurrency deals with lots of things at once; parallelism does lots of things at once.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go project, Effective Go, Concurrency; The Go Blog, Concurrency is not parallelism. CC-BY-4.0 (https://go.dev/copyright). Copyright The Go Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Go project, Effective Go, Concurrency; The Go Blog, Concurrency is not parallelism. CC-BY-4.0 (https://go.dev/copyright). Copyright The Go Authors.

Cite this

Permanent ID: iil:note:few6bwq8

iinventedlight. 2026. "Go goroutines: lightweight concurrent functions." iinventedlight Library, iil:note:few6bwq8, version of 2026-11-23. https://iinventedlight.com/library/notes/go-goroutines/. License: CC-BY-4.0.

@misc{iil_note_few6bwq8,
  author = {{iinventedlight}},
  title = {{Go goroutines: lightweight concurrent functions}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-23},
  url = {https://iinventedlight.com/library/notes/go-goroutines/},
  note = {Permanent ID iil:note:few6bwq8. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-goroutines.md.