8 ms·
A deeper problem is with Linux threads you can’t grow the stack beyond whatever limit you choose, so you either have to write all code with very limited stack u
by bboreham 8y ago
A deeper problem is with Linux threads you can’t grow the stack beyond whatever limit you choose, so you either have to write all code with very limited stack usage or set a big enough stack for the worst case. Which will be too big for millions of threads.
- pcwalton 8y agoStack growth should work in 1:1 just as it does in M:N. If the size were a hard constraint then Go couldn't get around it either.
- bboreham 8y agoThat doesn’t appear to be true. The thing doing scheduling has to cooperate with the thing doing stack management, so that context can be switched. What are those two things, in your proposition that we can simply use Linux threads?
- pcwalton 8y agoThe kernel has to restore registers, including the stack pointer, on a context switch. But it doesn't care about how big the allocation underpinning that stack is.