Solved Mandelbrot example : problems to understand the code
-
Hi,
I have a problem with the Mandelbrot QT example (QT Mandelbrot example), my CPU is running at 25% all the time, just like if a task was done in continue (I have around 1-2% when application is closed).
However no event come (I don't move the mouse or anything) and the code shows amutex.lock(); if (!restart) condition.wait(&mutex); restart = false; mutex.unlock();
If I understand those lines in source, the CPU should stop working when the render is done, why is it not the case? Are QThread always use the CPU like that?
Sébastien L.
-
The last render pass can take a lot of time. Put some debug output into the run function to see if the rendering is really finished.
-
Ok sorry, indeed the last 2 pass took several minutes to finish. I set the number of pass to 6 instead of 8 and get the result after 2-3 minutes. And then the CPU usage goes to 0% as supposed.
Thank you.