4 ms·
Do they shrink too? How many threads can be created before address space is exhausted (even if the memory isn't backed by pages, the address space is still rese
by uluyol 4y ago
Do they shrink too? How many threads can be created before address space is exhausted (even if the memory isn't backed by pages, the address space is still reserved)?
- tedunangst 4y agoThe stack for any thread other than the first is just memory like any other allocation. You can free it, resize it, copy it elsewhere, whatever you want to do. Literally just a pointer in a register. People work up weird mythologies about it, but the stack can be anything you want if you're willing to write code to manage it.
- jeffbee 4y agoYou'll run out of physical memory for the first page of the stack long before you run out of room in the virtual address space.