RE: Fw: Re: [AD] messy allegro 5.0 stuff

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


Title: RE: Fw: Re: [AD] messy allegro 5.0 stuff

> Yes, and also no. As they execute in an interrupt context,
> you can only
> really set a flag or two and the continue. You then need to poll the
> flag anyway, so why not just poll the device? OK, it is less efficient
> to call select() on your device, but it is more direct: there are no

You said it. If you have to be very reactive, you can use the
callback to set a flag, and check this flag from a lot of places
in your code. This is quite fast, *way* faster than polling the
actual input, which would probably syscall anyway, the scheduler
would maybe eat up your hard earned timeslice, maybe even swap
you out (OK, I'm a bit overborad here).

--
Vincent Penquerc'h



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