Concurrency

The below video was shared on Twitter.

It’s a really great view into concurrency and how Go’s system differs from “Threads” in other languages:

 

GoRoutines vs. Threads

At about 12:44 into the video Eyal gets into the methodology of Go concurrency (Go Routines) and how they differ from threads.

The memory stack of a Goroutine is very small. It starts at 2kb.

The go stack grows as needed and it also shrinks when no longer needed.

If 10,000 goroutines were created, they would only consume 20MB of memory.

The above values are much smaller than the stack size of threads.

 

#

Comments are closed

Archives
Categories