I start learning Multi-threading in C++ and I' m trying to crash and block my system by occupying all the processors. As fact I tried to create many threads and run them, but I didn't get what I need
void func()
{
std::cout << "C++11 MULTITHREADING\n";
for (int i = 1; i < INT_MAX; i++)
{
for (int j = 1; j < INT_MAX; j++)
std::cout << i / j << " ";
}
}
int main()
{
for (int i = 0; i < INT_MAX; i++)
{
std::thread t(func);
t.join();
}
std::cout << " ***END OF A PROGRAM***\n";
return 0;
}