I have to test an embedded computer for the most extreme conditions of generated heat and current draw, and to do so I want to write a program that employs the CPU resource as much as possible of a quad core CPU (one thread per core). Can you suggest something that would be very CPU hungry?
I have to do this for Linux on a ARMv7 and the language is C or C++, the other examples I have found are either for Windows or not in C/C++.
I am trying something like this on my Windows computer and apparently it is working as it takes 12% of total CPU power (which is a i7 quad core 2 threads per core):
float x = 1.5f;
while (1)
{
x *= sin(x) / atan(x) * tanh(x) * sqrt(x);
}
I don't know how to make it multi-thread.