On Thursday, 7 July 2016 at 22:36:29 UTC, Enamex wrote:
https://news.ycombinator.com/item?id=12042198
^ reposting a link in the right place.
While a program using 10,000 OS threads might perform poorly,
that number of goroutines is nothing unusual. One difference is
that a goroutine starts with a very small stack — only
2kB — which grows as needed, contrasted with the large
fixed-size stacks that are common elsewhere. Go’s function call
preamble makes sure there’s enough stack space for the next
call, and if not will move the goroutine’s stack to a larger
memory area — rewriting pointers as needed — before allowing
the call to continue.
Correct me if I'm wrong, but in D fibers allocate stack
statically, so we have to preallocate large stacks.
If yes - can we allocate stack frames on demand from some non-GC
area?