C ++ thread :: hardware_concurrency get hardware support for concurrent

First, the function of
acquiring hardware supported number of concurrent threads

Second, the return value is
the number of concurrent threads to support normal return, if the value is not well-defined or can not be calculated, it returns 0

Third, the parameter
no

四、示例
#include <iostream>
#include <thread>
 
int main()
{
    unsigned int in = std::thread::hardware_concurrency();
 
    std::cout << in << std::endl;
}


V. REFERENCE 
https://zh.cppreference.com/w/cpp/thread/thread/hardware_concurrency
 

Published 257 original articles · won praise 22 · views 90000 +

Guess you like

Origin blog.csdn.net/qq_24127015/article/details/104794635