1. 8
    1. 1

      I was looking at the last example and thinking “surely std::thread provides some way to set the thread stack size”.

      Seemingly, no: https://stackoverflow.com/questions/36775385/going-from-an-stdthread-to-the-related-pthread

      … As one of the replies says, the STL designers conceptualise “thread” as an abstraction that may not even have its own stack memory. So in practice you get whatever the default of the underlying implementation is…

      (EDIT: get that solving this well is hard, because of the possibility of fsplit-stacks or exotic runtimes, I’m just surprised they punted on it entirely. Even thread::native_handle can’t help I don’t think, as that is after the thread is created.)