nanogui: TIMERS
Subject:
Re: [nanogui] TIMERS
From:
Alex Holden ####@####.####
Date:
11 Jan 2006 15:31:02 +0000
Message-Id: <08A2C5A7-C0B6-4FDD-9E9D-DE4B34DCFA3A@linuxhacker.org>
On 11 Jan 2006, at 15:11, Robbie wrote:
> I believe the timer is not getting its share of slice and doing an
> IO somehow (I'm still digging through the API) allows it its time.
> I've attached a pice of code that shows this. It may run for a time
> or it may not run at all.
Polling GrCheckNextEvent() and calling an 'idle' function every time
you receive a GR_EVENT_TYPE_NONE is an unusual way of doing things.
Because there isn't a delay of any sort in idle(), you'll end up
calling it over and over as fast as possible using 100% CPU. Better
to do a GrGetNextEvent() and wait for an event to come in.
Also, you use the value of timer_tid without initialising it. Chances
are, gcc will initialise it to 0 for you, but it's not really a good
idea to rely on that.
--
------------ Alex Holden - http://www.alexholden.net/ ------------
If it doesn't work, you're not hitting it with a big enough hammer