4 ms·
> The wording sounds as if it is trying to assign blame for the problem. Yes. Sadly, people often write incorrect programs. > What, then, is the guaranteed th
by nsajko 5y ago
> The wording sounds as if it is trying to assign blame for the problem.
Yes. Sadly, people often write incorrect programs.
> What, then, is the guaranteed thread stack size?
I can't be bothered to look up the POSIX guarantees, the gist of it anyway is that it depends on the application developer and system administrator.
> A developer would obviously need to know this (and other things such as the amount of stack size required by variables, parameters and frames) to not fall into this trap of writing non-portable programs.
If you're not going to calculate the exact requirements (probably unnecessary), guess/measure a number of bytes and allocate a stack that's 50 or 100 times greater than that. That's better than ignoring the existence of the stack, anyway.