bearophile wrote:
From page 40:

Goroutines have "segmented stacks":
   go f()
starts f() executing concurrently on a new (small) stack.
Stack grows and shrinks as needed.
No programmer concern about stack size.
No possibility for stack overflow.
A couple of instructions of overhead on each function call, a huge improvement in simplicity and expressiveness.

There's a huge cost to it, however. You can't call C code directly anymore.

Anyhow, this problem simply goes away with 64 bits. You can allocate each thread gigabytes of address space, faulting it in as required, and still be able to have billions of threads.

Segmented stacks would have been a great idea 10 years ago.

Reply via email to