Thread is a natural OS object it’s have enough. Threads manipulations are expensive operations. They require switch to kernel return back, save and restore stack and so on. Many servers used threads but it’s unreal to keep a lot of threads and do not go out of resources. Also there’s a special task to synchronize them.

So new concept emerged - coroutine or coprogram. They could be imagined as parts of execution path between synchronization points: input-output, send-receive so on. They are very light and could be better orchestrated

So “threads but better”.

Answer from Eugene Lisitsky on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › go language › golang-goroutine-vs-thread
Golang | Goroutine vs Thread - GeeksforGeeks
July 12, 2025 - Goroutine: A Goroutine is a function or method which executes independently and simultaneously in connection with any other Goroutines present in your program. Or in other words, every concurrently executing activity in Go language is known ...
🌐
LinkedIn
linkedin.com › pulse › battle-concurrency-python-vs-go-lang-muhammad-haseeb
Battle of Concurrency | Goroutines vs Threads.
November 10, 2022 - They are only a few kb in stack size and the stack can grow and shrink according to needs of the application whereas in the case of threads the stack size has to be specified and is fixed. The Goroutines are multiplexed to fewer number of OS threads...
Discussions

multithreading - the difference between goroutine and thread - Stack Overflow
So “threads but better”. ... Sign up to request clarification or add additional context in comments. ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... New site design and philosophy for Stack Overflow: Starting February 24, 2026... I’m Jody, the Chief Product and Technology Officer at Stack Overflow. Let’s... 14 What is relationship between goroutine ... More on stackoverflow.com
🌐 stackoverflow.com
concurrency - How do goroutines work? (or: goroutines and OS threads relation) - Stack Overflow
How can other goroutines keep executing whilst invoking a syscall? (when using GOMAXPROCS=1) As far as I'm aware of, when invoking a syscall the thread gives up control until the syscall returns. H... More on stackoverflow.com
🌐 stackoverflow.com
Is it worth using Goroutines (or multi-threading in general) when nothing is blocking?
as others have mentioned, it depends on the context if you can decompose the task into pieces which can be worked on in parallel, then creating 'worker' goroutines which pick up these pending pieces of work one by one and complete them will be better able to utilise all the processors on your machine, and thus complete the overall task faster but since the gain depends on the actual code, best to do a benchmark with both More on reddit.com
🌐 r/golang
49
73
December 14, 2023
How can goroutines be more scalable than kernel threads, if the kernel threads only use a few pages of physical memory?
With M:N scheduling and channels, you can get further efficiency due to optimizations (limiting) in context switching. This talk explains it well: https://youtu.be/KBZlN0izeiY?t=536 . Watch through at least 18:50. More on reddit.com
🌐 r/golang
34
132
February 21, 2023
🌐
Tleyden
tleyden.github.io › blog › 2014 › 10 › 30 › goroutines-vs-threads
Goroutines vs Threads - Seven Story Rabbit Hole
One of the biggest drawback of threaded programming is the complexity and brittleness of many codebases that use threads to achieve high concurrency. There can be latent deadlocks and race conditions, and it can become near impossible to reason about the code. Go OTOH gives you primitives that allow you to avoid locking completely. The mantra is don’t communicate by sharing memory, share memory by communicating. In other words, if two goroutines need to share data, they can do so safely over a channel.
🌐
Medium
medium.com › @sairavitejachintakrindi › goroutines-and-threads-exploring-concurrency-in-go-370d609038c
Goroutines and Threads: Exploring Concurrency in Go | by Sai Ravi Teja | Medium
September 17, 2025 - Goroutines provide a higher level of abstraction, allowing developers to write concurrent code more easily. Threads: Operating System Entities On the other hand, threads are operating system-level entities responsible for executing code.
🌐
GoLinuxCloud
golinuxcloud.com › home › programming › goroutine vs threads in golang [8 differences]
Goroutine vs Threads in Golang [8 Differences] | GoLinuxCloud
January 4, 2024 - The use of the word "minimum" is very important here, as goroutines are not autonomous entities like UNIX processes – goroutines live in UNIX threads that live in UNIX processes.
🌐
Words from Shane
shane.ai › posts › threads-and-goroutines
Threads and Goroutines :: Words from Shane
June 12, 2023 - From a programmer point of view, a goroutine is basically a thread. It’s a function that runs concurrently (and potentially in parallel) with the rest of your program. Executing a function in a goroutine can allow you to utilize more CPU cores.
Find elsewhere
🌐
YourBasic
yourbasic.org › golang › goroutines-explained
Goroutines are lightweight threads · YourBasic Go
In general it’s not possible to arrange for threads to wait for each other by sleeping. Go’s main method for synchronization is to use channels. Goroutines are lightweight, costing little more than the allocation of stack space.
🌐
Jayconrod
jayconrod.com › posts › 128 › goroutines-the-concurrency-model-we-wanted-all-along
Goroutines: the concurrency model we wanted all along — jayconrod.com
July 2, 2023 - A goroutine is Go's version of a thread. Like threads in other languages, each goroutine has its own stack. Goroutines may execute in parallel, concurrently with other goroutines.
🌐
Medium
durgeshatal1995.medium.com › understanding-the-differences-between-go-routines-and-threads-b631068d4fdd
Understanding the Differences Between Go Routines and Threads | by durgesh atal | Medium
December 5, 2023 - A Go routine is a lightweight, independently executing unit of work managed by the Go runtime. Unlike traditional threads, Go routines are not OS threads; they are managed by the Go scheduler, allowing for efficient concurrency with minimal overhead.
🌐
DEV Community
dev.to › ankitmalikg › goroutine-vs-os-thread-3aae
Goroutine vs OS thread - DEV Community
July 1, 2023 - In conclusion, goroutines and OS threads offer distinct approaches to concurrency and parallelism. Goroutines, with their lightweight and efficient design, excel at managing concurrency and handling I/O-bound operations.
🌐
Google Groups
groups.google.com › g › golang-nuts › c › 0Szdmmy22pk
[go-nuts] Goroutines vs. Threads vs. Processes
But they can be moved between operating system threads if needed.(eg. when an operating system thread is going to be blocked by an syscall made by one of the go-routines you can move the other go-routines running on that operating system thread to another thread so they can keep running) wikipedia can provide more information. - jessta -- ===================== http://jessta.id.au ... Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message ... Some additional questions on Goroutines, I don't know if there is already a document answering this somewhere.
🌐
Google Groups
groups.google.com › g › golang-nuts › c › j51G7ieoKh4 › m › wxNaKkFEfvcJ
Goroutines vs OS threads
This is mainly because: > > 1. ... switching becomes significant > (isn't this true in Go as well?) The context of a goroutine is much smaller and easier to change than the context of an OS thread....
🌐
Reddit
reddit.com › r/golang › is it worth using goroutines (or multi-threading in general) when nothing is blocking?
r/golang on Reddit: Is it worth using Goroutines (or multi-threading in general) when nothing is blocking?
December 14, 2023 -

This is more of a computer science question, but for a program that has no blocking operations (e.g. file or network IO), and just needs to churn through some data, is it worth parallelising this? If the work needs to be done either way, does adding Goroutines make it any faster?

Sorry if this is a silly question, I've always seen multithreading as a way to handle totally different lines of execution, rather than just approaching the same line of execution with multiple threads.

🌐
TutorialsPoint
tutorialspoint.com › goroutine-vs-thread-in-golang
Goroutine vs Thread in Golang
April 18, 2023 - Goroutines and threads are both used for achieving concurrency in programming languages. In Golang, goroutines are the primary mechanism for achieving concurrency, while threads are a lower-level construct that is managed by the operating system.
🌐
TutorialsPoint
tutorialspoint.com › difference-between-goroutine-and-thread-in-golang
Difference between Goroutine and Thread in Golang.
November 28, 2019 - Goroutine Goroutine is method/function which can be executed independently along with other goroutines. Every concurrent activity in Go language is generally terms as gorountine. Thread Thread is a lightweight process. It can
🌐
Reddit
reddit.com › r/golang › how can goroutines be more scalable than kernel threads, if the kernel threads only use a few pages of physical memory?
r/golang on Reddit: How can goroutines be more scalable than kernel threads, if the kernel threads only use a few pages of physical memory?
February 21, 2023 -

I've been studying the way goroutines work under the hood and I'm confused about the memory usage benefits from goroutines.

From what I've read, one of the most cited advantages of goroutines is that it only allocates 2kb of memory of stack per goroutine, which grows dynamically according to usage, while kernel threads allocate a few MB of memory (Linux, Windows) by default, depending on the platform.

But from what I can understand, the few megabytes allocated by the kernel threads are allocated in virtual memory and initially only two pages are allocated in physical memory (one for the stack and one guard page), which would total 8kb in a system with 4kb pages. The OS then allocates more stack pages on demand until it reaches the total allocated virtual memory. This seems to be true both on Linux and Windows.

Shouldn't this give only a 4x reduction in memory usage of goroutines when compared to kernel threads? (which is a pretty big reduction, but not in the order that's often advertised in online articles)

I also understand that goroutines avoid some overheads from context switching that are necessary in kernel threads, since they avoid some userspace to kernel transitions. But in this article, Ron Pressler argues that the majority of the scalability benefits from user level threads comes from being able to do more things concurrently (due to less memory usage), rather than the elimination of task switching overheads.

So am I correct in believing that there would be only a ~4x improvement in scalability by using goroutines? are there other limits in play that reduces the scalability of kernel threads?

EDIT: My knowledge of operating systems concepts is quite rusty so there might be incorrect information in my question, particularly with regards to how the physical memory of threads are allocated. But I believe the question is still valid since the idea of the OS not immediately allocating a couple megabytes of physical memory seems to be true.


EDIT: If anyone is still interested. After researching a little bit more, it seems like the advantages of goroutines come down to having better granularity and being able to shrink the stack size.

On this HN thread, someone argued the same thing as me:

...; Take stack size for example: assuming the kernel stack is 10kB, if your thread itself uses 10kB of stack, you've cut the theoretical memory advantage of M:N down from the cited 1000x to a mere 2x…

To which Ron Pressler answered:

Ah, except that's not so easy to do. It's very hard to have "tight" stacks that are managed by the kernel for the reasons I mentioned here: (link to answer which I copy pasted below)

Once a page is committed, it cannot be uncommitted until the thread dies, because the OS can't be sure how much of the stack is actually used. It cannot even assume that only addresses above sp are used. Also, the granularity is that of a page, which could be significantly larger than a whole stack of some small, "shallow" thread, and we want lots of small threads.

This seems to be inline with Joe Armstrong says around 13 mins in this presentation about Erlang.

It's threads aren't in the programming language, threads are something in the operating system – and they inherit all the problems that they have in the operating system. One of the problems is granularity of the memory management system. The memory management in the operating system protects whole pages of memory, so the smallest size that a thread can be is the smallest size of a page. That's actually too big.

🌐
Coding Explorations
codingexplorations.com › blog › interview-series-understanding-goroutines-in-go
Interview Series: Understanding Goroutines in Go — Coding Explorations
November 3, 2023 - Goroutines are much smaller than threads, typically weighing in at around a few kilobytes in stack size at their creation. This stack can grow or shrink according to the needs of the program, allowing many more goroutines to be created compared ...
🌐
DEV Community
dev.to › gophers › what-are-goroutines-and-how-are-they-scheduled-2nj3
What are goroutines and how are they scheduled? - DEV Community
October 11, 2024 - Threads are much more expensive to create, use more memory and switching between threads takes longer. Goroutines are an abstraction over threads and a single Operating System thread can run many goroutines.