C++ examples for Thread:Thread Creation
Use thread::hardware_concurrency method to get the number of simultaneous threads supported
#include <iostream> #include <thread> using namespace std; int main(int argc, char* argv[]) { const unsigned int numberOfProcessors{ thread::hardware_concurrency() }; cout << "This system can run " << numberOfProcessors << " concurrent tasks" << endl; return 0;/* w w w .java 2s. c om*/ }