#include #include #include void cpuKiller(){ int* p; while(p == p){ (*p++)+1; } } int main(){ unsigned int cores = std::thread::hardware_concurrency(); std::cout << "cores: " << cores << std::endl; std::vector threads; //threads.reserve(cores); for(int i = 0; i < cores; i++){ std::thread t(cpuKiller); threads.push_back(move(t)); } std::cout << threads.size() << std::endl; for(int i = 0; i < cores; i++){ threads[i].join(); } }