From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2007-11-29 16:54:51
I'm not aware of a way to set the stack size for a new thread in either
Boost.Thread or the proposed std::thread. Is this something that
should be considered?
It seems that on my 32-bit Linux box I get 8 MByte stacks by default.
This allows a maximum of 512 threads per process with 32-bit
addresses. Although 8 MBytes and 512 threads should be OK for most
applications most of the time, it's not hard to imagine scenarios where
either 8 MBytes or 512 threads is not enough.
Would it be possible for the stack size to be an additional parameter
to the thread constructor, with a default?
(I don't think that the "native handle" in std::thread helps, since you
don't have that handle until the thread has been created at which point
it's too late. In any case, I guess that Windows must also have a way
to set the stack size, and it would be helpful to have an
OS-independent way to set it.)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk