Re: [AD] Using HPET in Linux/Unix? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] Using HPET in Linux/Unix?
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Fri, 26 Aug 2005 07:08:11 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=LI88XtEVTgRApxfqeC6EeNhFdIhCag0jb2xy1TqNcw58sOIw2zBABXO8vxbNuRHGO/9INTPF1Kblv5DxjfB7yZwYS18FjYMx1DjOEg3r7RS+lwzn9V5zl3MsYM6OicwkW9JHGAzpndI9Cg6gMgEfEHoGT/ma6nBYyapqtrMLC4I=
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.