After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 341600 - [eog-ng] EOG eats a lot o CPU when inactive
[eog-ng] EOG eats a lot o CPU when inactive
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-13 00:08 UTC by Claudio Saavedra
Modified: 2006-05-19 16:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.79 KB, patch)
2006-05-19 15:36 UTC, Paolo Borelli
none Details | Review

Description Claudio Saavedra 2006-05-13 00:08:48 UTC
I did a backtrace on all threads in a inactive EOG. There are only two threads, of wich the following is interesting:

Thread 2 (Thread -1498543184 (LWP 15791))

  • #0 __i686.get_pc_thunk.bx
    from /lib/tls/i686/cmov/libpthread.so.0
  • #1 pthread_mutex_lock
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 eog_render_thread
    at eog-job-queue.c line 93
  • #3 g_thread_create_proxy
    at gthread.c line 562
  • #4 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #5 clone
    from /lib/tls/i686/cmov/libc.so.6

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.
Comment 1 Paolo Borelli 2006-05-19 15:36:18 UTC
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.
Comment 2 Lucas Rocha 2006-05-19 16:24:40 UTC
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>.