为什么创建的线程数小于thread-max?

Gha*_*ani 5 c++ multithreading gcc gcc9

使用此代码:

void yield_sleep(void)
{
    using namespace std::chrono;

    static size_t thread_num;

    auto start{high_resolution_clock::now()};
    std::this_thread::yield();
    auto end{high_resolution_clock::now()};

    std::cout << thread_num++
              << "|Waiting for: "
              << duration_cast<microseconds>(end - start).count()
              << " ms."
              << std::endl;
}

int main(void)
{
    std::vector<std::thread> tp(62434);

    std::generate(tp.begin(), tp.end(), []() { return std::thread(yield_sleep); });
    std::for_each(tp.begin(), tp.end(), [](auto& t) { t.join(); });
}
Run Code Online (Sandbox Code Playgroud)

程序创建 ~32718 线程并抛出异常:

terminate called after throwing an instance of 'std::system_error'
  what():  Resource temporarily unavailable
Run Code Online (Sandbox Code Playgroud)

但是里面/proc/sys/kernel/threads-max的值是62434。有什么问题?为什么我的程序在创建线程期间抛出异常?