On Friday, 11 December 2015 at 01:25:24 UTC, Ola Fosheim Gr wrote:
On Thursday, 10 December 2015 at 23:25:42 UTC, Chris Wright wrote:
This doesn't work well for 32-bit processes because, while it doesn't demand memory up front, it does demand address space. But lazily demanding pages from the OS doesn't help. You still have to divide the address space among fiber stacks.

it does not work for 64 bit either. You will:

1. Kill caches and TLB
2. Get bloated page tables.
3. Run out of memory.
4. Run out of stack space.


Benchmark needed. It not like the stack is randomly accessed, so I don't think the TLB argument makes a lot of sense.

I mean, yes, if you run tens of thousand of fibers maybe you'll experience that, but that doesn't sound like a very smart plan to boot.

These 3 approaches work:

1. Allocate all activation records on the heap (Simula/Beta)
2. Use stacks that grows and shrink dynamically (Go)
3. Require no state on stack at yield. (Pony / C++17)


Reply via email to