[PATCH] use timeout instead of idle for Queue polling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Brian C. Lane" <bcl@xxxxxxxxxx>

The Queue poll inside the GLib idle state was causing 100% CPU usage, it
was being called multiple times per second. It would be more efficient
to be able to use a select() or poll() with the Queue, but that isn't
possible. So, run the Queue processing in a 1 second timeout. CPU usage
drops to almost nothing.
---
 pyanaconda/ui/gui/hubs/__init__.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index 498f6dc..40cc6ef 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -229,6 +229,7 @@ class Hub(UIObject):
             # acting on.  If no such spoke exists, throw the message away.
             spoke = self._spokes.get(args[0], None)
             if not spoke:
+                q.task_done()
                 continue
 
             if code in [communication.HUB_CODE_READY, communication.HUB_CODE_NOT_READY]:
@@ -251,7 +252,7 @@ class Hub(UIObject):
         UIObject.refresh(self)
         self._createBox()
 
-        self._update_spoke_id = GLib.idle_add(self._update_spokes)
+        self._update_spoke_id = GLib.timeout_add_seconds(1, self._update_spokes)
 
     ### SIGNAL HANDLERS
 
-- 
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux