by hygh · 5y ago · 0 comments
I do not understand why musl doesn't move to at least 512K like OSX.
The generous 8192K glibc thread stack size isn't actually used on Linux with overallocation, so I fail to see why musl chose that small default in the first place.
"Since 1.1.21, musl supports increasing the default thread stack size via the PT_GNU_STACK program header, which can be set at link time via -Wl,-z,stack-size=N." Of course you can always use pthread_attr_setstacksize
It won’t really: that’s vmem, it’ll only need a bit of memory for the accounting of the mappings in the kernel.
No you can't, not with std::thread, which makes std::thread nearly unusable with musl.
Is it even (over)committed? The main reason for having a max stack size is multithreading, but I'm not sure why it should be committed at all. Surely, an unbounded single thread stack is not precommitted to infinity?