Re: [AD] Using HPET in Linux/Unix?

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


On Friday 26 August 2005 06:30 am, Elias Pschernig wrote:
> Makes sense. I assume, that's how it already works, i.e. the background
> thread is independent of the timer driver in use.

AFAIK, there is only one useable timer driver in Unix, which is the 
multi-threaded one. There is/was a signal-based one for systems without 
threads, but I believe we were going to (if we haven't already) drop that 
since it caused too many problems with Xlib async errors.

With this, however, we would keep the threaded bg callback manager for 
X-related stuff (since it makes things so much simpler when using 
xlock/mutex's), and put the sound/non-X stuff into user timers.

> Yes. Maybe we should include a simple example showing how it is done.
> The important part of that example would be the difference of
> linux/windows/OSX.. I assume, it would mainly be what header to include,
> and how to link.

If we go with encouraging pthreads, wouldn't it be basically the same on all 
platforms? Since pthreads is really just an API, you just include pthread.h, 
use the pthread_ functions as described in the API, and link with 
-lpthread/pthread.lib. An example would definitely be nice (though detecting 
pthreads in Windows would be tricky), but I don't think there's 
platform-specific stuff to worry about.




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