October 2018
Beginner
794 pages
19h 23m
English
Knowing, and being able to change, the size of thread stacks does matter (do see the link provided in the Further reading section on the GitHub repository, which mentions a real-world experience on how setting up a stack that's too small for a certain platform caused random and really hard-to-debug failures).
So, what is the default thread stack size? The answer has already been provided; recall the disp_defattr_pthread program we ran earlier in this chapter (in the Code example – querying the default thread attributes section): it shows us that the default thread stack size on the (modern NPTL) Linux platform is 8 MB.
The pthreads API set provides a few routines to set and query the thread stack size. One way ...
Read now
Unlock full access