[AD] About timer driver for Unix

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


Peter Wang <tjaden@xxxxxxxxxx> writes:

> I managed to track down where Allegro was conflicting with SVGAlib
> with regards to the VESA driver.  It was SIGALRM, so switching it
> off and on and using some DISABLE/ENABLE pairs at the right places
> fixed it up...

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.

I have tested different methods of waiting for short period of time,
all of usleep, nanosleep, setitimer, select can not give period
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.

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

I can not work on Allegro development now, I need to install Linux on
computer at work.  If anyone else wants to implement this driver, I
can post test program.

-- 
Michael Bukin



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