3 ms·
Besides the stack size there's also the switching overhead involved when you go through the kernel. And yes, the dynamic stack growth is an extremely important
by slrz 10y ago
Besides the stack size there's also the switching overhead involved when you go through the kernel.
And yes, the dynamic stack growth is an extremely important part of it. Without it, you'd just have small stacks. Take an arbitrary pthreads program and restrict its stacks to a few kb. You won't have much fun. The code really needs to be written such that it can cope with small stacks. That can be tedious, so you don't want to do it for run-of-the-mill userspace code. Dynamically-sized stacks give you the best of both worlds.
- pcwalton 10y agoYou can use dynamically-sized stacks with pthreads. Nothing says you can't. Dynamically sized stacks are a property of GC, not userland threads. This is a common misconception.