Re: [AD] rest and yield_timeslice

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


Elias Pschernig wrote:
No. select does just what we want (same as usleep, but usleep is
deprecated according to my docs).

According to my man pages, select is 4.4BSD. nanosleep is POSIX.1b(formerly POSIX.4). Pas that it's a crude hack, using a function for something it wasn't designed for. That in and of itself isnt't a big deal.. but when we have a fully POSIX-compliant alternative?

And from what I've heard, select is fully dependable, either.

Good point. I copied the code from timer.c actually - so that would need
changing as well then, at least for unix. (Or do djgpp/mingw have
gettimeofday?)

IIRC, MinGW does have gettimeofday, and I think I used it in DJGPP once. I can't say how accurate it is there though (I would doubt any worse than 10ms).

Yes, I'm proposing it with my mail. If there are complaints against it,
we can keep long. I see no point in having a signed variable though.

Apologies. I thought you said you were going to be commiting it. However, in my experience you don't really need to use the signed or unsigned keywords unless you a) need the increased max, or b) can't handle negative numbers. And calling rest(0x80000000u) will effectively rest you for several days or weeks.. I doubt we need that. And we can deal with negatives just fine (time <= 0 instead of !time). Plus, rest has always been non-unsigned, so you'd need a good reason to change it, IMO.

- Kitty Cat




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