[Live-devel] select() timeout parameter inside BasicTaskScheduler::SingleStep()

Frederic Bouilhaguet bouilhaguet at resonate-mp4.com
Wed Dec 1 09:35:01 PST 2004


Dear Ross, all

Could you help me to understand the use of fDelayQueue in
BasicTaskScheduler::SingleStep(unsigned maxDelayTime) ? For each call to
fDelayQueue.timeToNextAlarm(), the returned timeToDelay I get is larger than
1 million seconds... This implies that tv_timeToDelay.tv_sec is then always
set to MAX_TV_SEC (= one MILLION of seconds), and so never to the
maxDelayTime paramater passed in SingleStep(). Why ? Did I miss something ? 
   
Then, I think there is a bug in the current computation of the timeout
parameter of select()... The following test : 
(tv_timeToDelay.tv_sec*MILLION+tv_timeToDelay.tv_usec) > (long)maxDelayTime 
can not be right if the tv_timeToDelay.tv_sec value is equal to one MILLION
because in this case tv_timeToDelay.tv_sec*MILLION will exceed the max value
of a 4 bytes long. Am I right ?

The consequence of this is that the timeout of select() is never set to the
maxDelayTime parameter of SingleStep(). Is this the normal situation ? 

Thanks for you help.

Frederic Bouilhaguet
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2172 bytes
Desc: not available
Url : http://lists.live.com/pipermail/live-devel/attachments/20041201/be2bdffa/winmail.bin


More information about the live-devel mailing list