by romed · 8y ago · 0 comments
"each OS thread has its own fixed-size stack."
100% wrong.
From a virtual memory standpoint, every thread would appear to have a fixed size which can be set when you create it. [0]
From a physical memory standpoint, every thread would appear to have a dynamic size (but bounded by the virtual memory size of course).
[0] http://man7.org/linux/man-pages/man3/pthread_create.3.html
FTA: "With 4KB per stack, you can put 2.5 million goroutines in a gigabyte of RAM – a huge improvement over Java’s 1MB per thread"