Re: [AD] X and pthreads

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


On Tue, Mar 20, 2001 at 03:17:19PM +0100, Angelo Mottola wrote:
> I don't like the option to poll for incoming events from the programs; the
> best solution seems to me to use pthreads, but how much portable is it? From
> what you're saying, it seems it's not available on all type of Unices...

I'm not sure.  It is POSIX threads, so they should all have it,
but I don't really know.  I doubt there is any commercial
version of Linux which does not have it.

> About the possible change, remember also the DGA2 driver has a builtin event
> handler, which is almost a copy of the xwin one, with little differences to
> use some DGA input calls instead of X ones. I put it separated as I didn't
> want to make the xwin handler messier than how much it already is... So if
> the changes are ever applied, apply them also to xdga2.c, or even better
> merge the two handlers into a single entity.

Yes, I noticed that and deliberately didn't run any programs
that might use DGA2. :)  I should have mentioned that in the
last email.

I've been wondering whether we should have some way to chain X
event processing functions.  It might be useful for the user to
be able to override the default handling (AllegroGL does this by
having special hooks inside the Allegro code, but that's messy).

The event processing function would look through a list of
registered event handlers for a match to the event type, and if
it's found then call that function.  Otherwise perform default
processing, and if the event was not handled even by the default
processing then maybe it should be passed on to another user
callback.  The DGA system would just hook its own handlers into
this.  I'm not sure at the moment whether multiple handlers
should get called for one event.

George



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