Re: [AD] About timer driver for Unix

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


On Sun, Mar 26, 2000 at 10:42:48AM +0700, Michael Bukin wrote:
> BTW, it is possible to remove SIGALRM from Unix timer.  Allegro
> program forks inside timer init and forked thread constantly sends
> signals (e.g. SIGUSR1) to main thread, main thread handles timer tick
> in SIGUSR1 handler and acknowledges interrupt by sending signal to
> timer thread.  Timer thread then waits for short interval and sends
> SIGUSR1 to main thread again.

That's not possible in the console version, because we use
SIGUSR1 and SIGUSR2 for notification on console switches (one
for switch in, one for switch out).  I can't see any other way
to do this notification (can we use any other signals?).

> shorter than 10 msec, but it is possible to get less than 1 msec by
> waiting in a dead loop and testing passed time with gettimeofday.

I'd guess that even that only works if that thread never loses
the CPU; in that case it wouldn't be a great way to implement
asynchronous timers. :)

> It can remove interference between Allegro, ESD and SVGAlib, but it
> will need SIGUSR1 or some other signal and may add problems with
> forking.

It sounds great for the X version, but even if Allegro's console
system can be changed away from using SIGUSR1 and SIGUSR2,
SVGAlib does exactly the same thing internally.

George

-- 
Random project update:
06/02/2000: AllegroGL alpha 3: use OpenGL with Allegro in Unix or Windows
	http://www.canvaslink.com/gfoot/allegrogl/



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