Re: [AD] rest and yield_timeslice |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
The attached patch:
- Reverts the yield_timeslice patch from some time ago, making windows
use Sleep(0) again in yield_timeslice, and re-introduces sched_yield to
unix.
- Changes the parameter to rest from long to unsigned long, which seems
to make much more sense to me.
- Implements a rest method to the unix timer driver, following the
example of the windows driver. This driver apparently is also used by
the OSX port.
- Makes rest(0) do the same as yield_timeslice, so we can deprecate the
latter.
The last point is only a single if in timer.c, and currently it looks
like Angelo and me think it is better to deprecate yield_timeslice,
Chris thinks not, and Evert tends to not deprecate, but has no real
strong opinion on either. So I think I can apply it.
What needs to be done after this patch is applied:
- Implement the OSX system_driver.yield_timeslice method, currently it
still has that sleep. Probably just change the parameter to 0.
- Look over BeOS, QNX, DOS, MacOS9 ports. They should have the same
behavior as the main ones.
- Change the GUI, readkey, and examples to not use yield_timeslice. This
needs to be done regardless of deprecating it or not, since rest is the
way to give up CPU when being idle with that patch.
--
Elias Pschernig