How to set the stacksize with C++11 std::thread

Initially I come from a posix threads background, and was wondering how does one setup the stack size of the std::thread prior to construction, as I can’t seem to find any references to performing such a task.

You can’t. std::thread doesn’t support this because std::thread is standardized, and C++ does not require that a machine even has a stack, much less a fixed-size one.

pthreads are more restrictive in terms of the hardware that they support, and it assumes that there is some fixed stack size per thread. (So you can configure this)

Leave a Comment