GNOME Bugzilla – Bug 341600
[eog-ng] EOG eats a lot o CPU when inactive
Last modified: 2006-05-19 16:24:40 UTC
I did a backtrace on all threads in a inactive EOG. There are only two threads, of wich the following is interesting:
+ Trace 68193
Thread 2 (Thread -1498543184 (LWP 15791))
Checking eog_render_thread (), there is a infinite loop (while (TRUE)) without a break condition. I think this is the reason why eog eats so much CPU. eog-ng branch.
Created attachment 65845 [details] [review] patch this is because you need a condition to wait on: the thread is put to sleep and awakened only when something is added to the job queue. Without that the thread is busy-waiting for something to do. Patch based on evince code.
Applied, thanks! 2006-05-19 Lucas Rocha <lucasr@gnome.org> * libeog/eog-job-queue.c (eog_render_thread, no_jobs_available_unlocked, -add_job_to_queue, +add_job_to_queue_locked): make the job manager thread sleep when there are no jobs on the queues (Fixed bug #341600). Patch from Paolo Borelli <pborelli@katamail.com>.