Re: [AD] rest and yield_timeslice

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sunday 18 July 2004 12:50, Chris wrote:
> Yeah. Hopefully we can keep it up. :) Though we do badly need developers 
> that use Windows.

Yeah, I was thinking we could probably let 4.1.15 WIP go with a call for 
extra Windows developers (unless people already subscribed, such as V 
Karthik Kumar or Oscar Giner want to contribute more). It probably looks 
better to do it with a WIP release than to do it now without anything to 
show we've been busy ;)

Personally I don't know how my time is going to hold out after august.  But 
we'll see then.

> Actually, currently they call nothing. They do a busy wait that calls 
> yield_timeslice. Previously however, they used select. My and Elias 
> talked this over the other night/morning and we came to the conclusion 
> that nanosleep would be a better function to rest with. It's 
> POSIX-compliant unlike usleep, it's more flexible, and under certain 
> situations can be more accurate than other rest functions.

Sounds great.

> If it actually rests, yes (x > 0). But if you're not waiting (x <= 0), 
> it shouldn't yield or reschedule at all.

I somewhat agree. This would be how I expect a rest function to behave at 
any rate.
I don't have a strong opinion on wether rest(0) should yield or not though.

> Because the two serve two different functions. One rests when you have 
> nothing to do (and when you rest for <= 0ms, you obviously have 
> something to do), the other plays nice and shares the CPU with other 
> programs.

I agree. Having one function that serves two logically different purposes, 
depending on its argument, is less clean than having two functions for 
each logical task.

Evert





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/