Bug 205008 - please consider adding apprimate timeout functions (gnome BZ 353942)
please consider adding apprimate timeout functions (gnome BZ 353942)
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: glib2 (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Matthias Clasen
http://bugzilla.gnome.org/show_bug.cg...
:
Depends On:
Blocks: wakeup
  Show dependency treegraph
 
Reported: 2006-09-02 04:39 EDT by Arjan van de Ven
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-02 11:29:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
GNOME Desktop 353942 None None None Never

  None (edit)
Description Arjan van de Ven 2006-09-02 04:39:39 EDT
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
|-----X----X-------XX----X----X----|


<with patch

0                                  1
|XX--------------------------------|


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 04:39:39 EDT
Created attachment 135424 [details]
add g_timeout_approx() and friends
Comment 2 Matthias Clasen 2006-09-02 11:27:27 EDT
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 11:29:50 EDT
Actually, lets track this upstream.

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