4 ms·
On a Unix-like OS you can do ulimit -s <stack-size-in-KiB> At least you only have to set it once per shell instance; put it in your shell init file (bashrc
by tempodox 6y ago
On a Unix-like OS you can do
ulimit -s <stack-size-in-KiB>
At least you only have to set it once per shell instance; put it in your shell init file (bashrc or whatever).
- CJefferson 6y agoThe problem is, it's hard to distribute libraries which want lots of stack space, because not everyone will do that. In Rust (where threadsafety is easy and cheap), I tend to just spin up a thread of known (large) stack size, and do computations there.
- tempodox 6y agoI see. And the end user might not even know that library is built into the tool they use, or know how to alter the stack size limit on their machine. So I can't think of a better solution either.
- ufo 6y agoCan a process increase their own stack limit or do they need to spawn a child process with a higher limit?