nanogui: TIMERS


Previous by date: 11 Jan 2006 15:47:13 +0000 Re: TIMERS, Alex Holden
Next by date: 11 Jan 2006 15:47:13 +0000 Re: TIMERS, Alex Holden
Previous in thread: 11 Jan 2006 15:47:13 +0000 Re: TIMERS, Alex Holden
Next in thread: 11 Jan 2006 15:47:13 +0000 Re: TIMERS, Alex Holden

Subject: Re: [nanogui] TIMERS
From: "Robbie" ####@####.####
Date: 11 Jan 2006 15:47:13 +0000
Message-Id: <20060111154706.AE7013DF2@xprdmailfe12.nwk.excite.com>

The sample code it really just that, a sample. Even in this case I don't understand why that should be a problem. The loop is to continually check for events and the idle call has nothing to it except when the timer has expired. Also, this idle in intented to several other tasks when nothing is happening. If memory serve me right, I believe the reason I chose CheckNext, instead of GetNext if a delay  involved with GetNext. I stand corrected incase there is something I may have misunderstood from the API. ??  


 --- On Wed 01/11, Alex Holden < ####@####.#### > wrote:
From: Alex Holden [mailto: ####@####.####
To: ####@####.####
     Cc: ####@####.####
Date: Wed, 11 Jan 2006 15:30:59 +0000
Subject: Re: [nanogui] TIMERS

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.

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



Previous by date: 11 Jan 2006 15:47:13 +0000 Re: TIMERS, Alex Holden
Next by date: 11 Jan 2006 15:47:13 +0000 Re: TIMERS, Alex Holden
Previous in thread: 11 Jan 2006 15:47:13 +0000 Re: TIMERS, Alex Holden
Next in thread: 11 Jan 2006 15:47:13 +0000 Re: TIMERS, Alex Holden


Powered by ezmlm-browse 0.20.