Default stack size

Tim Prince tprince@computer.org
Wed Sep 26 23:41:00 GMT 2007


John (Eljay) Love-Jensen wrote:
> Hi Juan,
>
>   
>> Is there an c/c++ compiler or linker option to set the default stack size of a thread?
>>     
>
> No.  Threading is not part of the C (ISO 9899) or C++ (ISO 14882) specification.  Alas.
>
>   
>> Is it possible to get in runtime the default stack size?
>>     
>
> Depends on your platform.
>
> Depending on your platform, the default stack size may be determined by your OS (e.g., Unix), or the hardware (e.g., 6502), or your compiler (e.g., Amiga OS and Manx, Lattice or SAS).
>   
Thread stack size may be controlled by calls into, or environment 
variable settings of, an OpenMP library (more possibilities in the 
compiler category), presumably altering the defaults of the threading 
library provided for the OS.



More information about the Gcc-help mailing list