Answer the question
In order to leave comments, you need to log in
How to make a program that loads a computer?
Salam. The question is: What is needed in order to make a program that loads the computer as much as possible (RAM, video card, processor, etc.). Need to create many variables in an infinite loop or what? Can you help????
Answer the question
In order to leave comments, you need to log in
1. Take the algorithm for calculating the number pi up to a hundred-thousandth sign, arrange it in the form of a stream. Also start flows as much as it is necessary for loading.
2. Do the same as in point 1, only using gpu
3. Run a thread in a thread, allocate memory blocks, fill with random values, put the thread to sleep for some random value of seconds, and then free the memory.
Just load the percent, video, memory.
Infinitely create threads that create many variables (1000 for example) in which there is a lot of text, and endlessly calculate the result, and then add the result to the array. It will definitely load the RAM under 100, it can also, with a vidyuhi it is more difficult, there you need to use CAL ++ to also perform calculations.
Loads cpu
#include <thread>
#include <vector>
int main() {
std::vector<std::thread> threads;
for (size_t i = 0; i < std::thread::hardware_concurrency(); ++i) {
threads.push_back(std::thread([]() {
int i;
while (true) {
++i;
}
}));
}
for (auto& thread : threads)
thread.join();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question