New slides about Go

Walter Bright newshound2 at digitalmars.com
Thu Oct 14 15:10:16 PDT 2010


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.


More information about the Digitalmars-d mailing list