News for hackers. Stuff that matters.
Re:Why you can have millions of goroutines but only thousand... by pcwalton on Monday October 08, 2018 @08:38PM (#18172477)
This post is wrong. OS threads do not have a fixed-size stack in the 1:1 model. After all, if they did, then Go couldn't do stack growth, because goroutines are implemented as a layer on top of native threads. There are language runtimes, such as SML/NJ, that heap allocate all stack frames, and the kernel doesn't complain.

Additionally, as others have pointed out, Java (and, for that matter, all native code on Linux) used to use the Go model and switched to 1:1.

Re:Why you can have millions of goroutines but only thousand... by emfree on Monday October 08, 2018 @09:30PM (#18172699)
Goroutine stacks are in fact allocated on the heap. All the details are in here: https://github.com/golang/go/blob/master/src/runtime/stack.g...
Re:Why you can have millions of goroutines but only thousand... by pcwalton on Monday October 08, 2018 @10:49PM (#18172971)
By heap allocating stack frames I mean that each time you call a function, SML/NJ allocates space for that individual frame on the heap. It then uses the garbage collector to clean up frames after the function call has returned.
Re:Why you can have millions of goroutines but only thousand... by twic on Tuesday October 09, 2018 @08:39AM (#18175395)
Smalltalk-80 did this too. Later implementations try to avoid it, but sometimes still do:

http://www.wirfs-brock.com/allen/things/smalltalk-things/eff...