Re 5: pthread allows setting the stack size of each individual thread although this is seldom done in practice as on 64 bit address space is not at premium.
GCC also, on some platforms, allows using segmented stacks on any C and C++ programs which means that a thread will only use only as much physical and virtual memory as required. I don't think segmented stacks have seen much use though as they have non zero cost and, for optimal space usage, ideally require recompiling any dependncy, including glibc with them.
Interestingly segmented stacks were implemented to support GCCGO.
GCC also, on some platforms, allows using segmented stacks on any C and C++ programs which means that a thread will only use only as much physical and virtual memory as required. I don't think segmented stacks have seen much use though as they have non zero cost and, for optimal space usage, ideally require recompiling any dependncy, including glibc with them.
Interestingly segmented stacks were implemented to support GCCGO.