Bug 205008 - please consider adding apprimate timeout functions (gnome BZ 353942)
Summary: please consider adding apprimate timeout functions (gnome BZ 353942)
Alias: None
Product: Fedora
Classification: Fedora
Component: glib2
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Matthias Clasen
QA Contact:
URL: http://bugzilla.gnome.org/show_bug.cg...
Depends On:
Blocks: wakeup
TreeView+ depends on / blocked
Reported: 2006-09-02 08:39 UTC by Arjan van de Ven
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-09-02 15:29:50 UTC

Attachments (Terms of Use)
add g_timeout_approx() and friends (5.96 KB, patch)
2006-09-02 08:39 UTC, Arjan van de Ven
no flags Details | Diff

System ID Priority Status Summary Last Updated
GNOME Bugzilla 353942 None None None Never

Description Arjan van de Ven 2006-09-02 08:39:39 UTC
Description of problem:
The patch that I will attach adds a variant of g_timeout_add to the glib API,
g_timeout_add_approx(). The goal of the _approx version is to allow the
application to indicate that the timeout is an approximate value, and that the
application doesn't care a great deal about the exact time this timer will
fire. The implementation in the patch uses this "no need to be exact"
information to schedule the timer only on "whole wallclock seconds". 

The effect of this is that applications that have multiple such timers running
in parallel will have less context switches/wakeups because the timers will
naturally group together this way into one wakeup moment. 

The effect is bigger than just the single app; on a system level, all such
timers from all glib using applications will wake up around the same time in
the second. This is an advantage for the following reason: (ascii art of 1
second, the X denotes a wakeup of any app)

<current situation; random wakeups during the second>

0                                  1

<with patch

0                                  1

in the <with patch> situation the processor and the system can sleep for a much
longer time, which allows for much greater power savings than the continuously
waking up case.

This is useful for power savings, but also for the virtualization case where
frequent wakeups are also a cause for performance costs.

Comment 1 Arjan van de Ven 2006-09-02 08:39:39 UTC
Created attachment 135424 [details]
add g_timeout_approx() and friends

Comment 2 Matthias Clasen 2006-09-02 15:27:27 UTC
I think the docs ought to say something more about the adjustments which glib
may do to the timeout. 

Comment 3 Matthias Clasen 2006-09-02 15:29:50 UTC
Actually, lets track this upstream.

Note You need to log in before you can comment on or make changes to this bug.