#4680 NORM Future : Sugar apps' pygtk main loop polls 10 times a second, always

Zarro Boogs per Child bugtracker at laptop.org
Tue Jan 22 04:11:21 EST 2008


#4680: Sugar apps' pygtk main loop polls 10 times a second, always
---------------------+------------------------------------------------------
  Reporter:  gnu     |       Owner:  marco             
      Type:  defect  |      Status:  new               
  Priority:  normal  |   Milestone:  Future Release    
 Component:  sugar   |     Version:  Build 623         
Resolution:          |    Keywords:  power, performance
  Verified:  0       |    Blocking:                    
 Blockedby:          |  
---------------------+------------------------------------------------------

Comment(by gnu):

 Hooray!  Python 2.6 now includes an interface that causes low-level signal
 handlers to write a single zero byte to a user-set file descriptor.  This
 allows a library like PyGTK to use a pipe to break out of its select() or
 poll() loop and process the signal in the main thread.  Which means the
 main thread doesn't have to wake up all the time to check for a pending
 signal.

 This is described in [http://blogs.gnome.org/johan/2008/01/04/enough-
 wakeups-in-python-programs/ Johan Dahlin's blog entry],
 [http://bugs.python.org/issue1583 Python Issue 1583] (which includes
 [http://bugs.python.org/file8988/python2.6-set_wakeup_fd4.diff this final
 patch] from Father Guido), and in [http://mail.gnome.org/archives/gnome-
 announce-list/2008-January/msg00002.html the PyGObject 2.14.1
 announcement] and
 [http://www.daa.com.au/pipermail/pygtk/2008-January/014707.html the PyGTK
 2.12.1 announcement], which use the interface (if available) to eliminate
 polling.

 Johan recommends that people who care about eliminating these wakeups
 should patch their current Python interpreter to add this interface,
 rather than wait for 2.6.

-- 
Ticket URL: <http://dev.laptop.org/ticket/4680#comment:12>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list