[Sugar-devel] pygame activities stop XO sleep?
bernie at codewiz.org
Thu Dec 30 18:58:48 EST 2010
On Thu, 2010-12-30 at 17:21 -0500, Paul Fox wrote:
> while running, Boxes consumes over 80% of the CPU (on my 1.5), even
> though the display is, as far as i can tell, completely static. if
> this happens with other pygame-based activities, then something is
> broken in pygame.
I'm afraid this behavior is by design.
Unlike GUI applications, videogames aren't typically event driven. They
sit in a main loop that checks for input, updates the position of all
objects and refreshes the screen.
Typically this loop runs as fast as possible, but some games may have a
rate-limiting delay set at the screen refresh rate. Classic arcade games
used to do all the heacy work from the vblank interrupt rather than a
main loop, to provide frame-perfect animation.
Even if we could teach powerd to detect this case, I'm not sure that
suspending the CPU while a game is running is what the users want.
To help the users understand the problem, perhaps we could visualize the
"can't suspend now" graphically in the resource indicator on the frame
(which is only in Dextrose at this time).
// Bernie Innocenti - http://codewiz.org/
\X/ Sugar Labs - http://sugarlabs.org/
More information about the Sugar-devel