[AD] Using HPET in Linux/Unix?

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


I've been pondering the ability to use HPET (High-Precision Event Timers) for 
Allegro's timer support in Linux (or general Unix, if available). The API 
seems to be simple enough.. a command to register a timer, one to stop the 
timer, and one to dynamicly change options of a timer. Besides potentially 
being more precise than threads allow, it uses a proper timer system, instead 
of one emulated with threads. A page that Thomas Fjellstrom found on the 
subject is here:

http://www.linuxhq.com/kernel/v2.6/8/Documentation/hpet.txt

I know this won't make it in for 4.2.0, but it could potentially be included 
in 4.2.1 since adding symbols won't break backwards compatibility with Unix 
shared libs.

I was curious if anyone's thought of this, or if you think it'd be too 
dangerous to switch away from a multi-threaded timer model. The X 
input/graphics stuff (which would be better off in another thread since it 
needs proper mutex locks) is run in a bg manager system which can continue to 
use a thread, but user timers and sound mixing (which can be moved into a 
user timer) should be able to switch to it fine and benefit from increased 
accuracy.




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