Re: [AD] Windowed drivers color conversion

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


On Fri, May 04, 2001 at 10:30:04PM +0200, Angelo Mottola wrote:
> About pthread and QNX: I never used threads on an unix system, so I am a
> newbie in pthread development... Anyway I found the lib easier to use than I
> thought, and I think applying the same method for events handling to Unix
> Allegro would be just as easy. I haven't checked George's CVS branch yet; is
> that already completed and working? In any case I really think threading is
> the way to go also because I'm a fan of AllegroGL, and I want those silly
> allegro_gl_begin()/allegro_gl_end() to vanish...

I want to look into this further this weekend, taking advantage
of the bank holiday. :)  At the moment, the branch is working
well enough that allegro_gl_begin and allegro_gl_end are no
longer required.  The problem with hanging the X server is gone;
but a remaining problem is that the thread I fire off seems to
not respond well enough to the events.  I think perhaps it's
saturating the X server, in fact, with requests for event --
it's possible that a simple sleep in the thread will solve this.

I can't be sure of the safety of the threaded version of the X
code though; there are a lot of function intertwined there, and
there's a chance that non-atomic accesses could break things.

The code I wrote is based around the idea of background routines
-- basically, these are routines which are called periodically
in the background.  This is implemented by SIGALRM if pthreads
is not available, or pthreads otherwise.  The SIGALRM version
basically calls the routine every 10ms, while the pthreads
version calls the routine continuously from a different thread.

It's quite a nice abstraction, but the routines do need to know
whether they're being called in a separate thread or not --
under SIGALRM it's disastrous if a background routine selects
while waiting for input, while in pthreads that's the ideal
thing for them to do.  So, it's not totally abstract. :)  The
nice part about it, though, is that pthreads is not absolutely
required.  It *will* be required for AllegroGL though, I don't
want to maintain backwards compatibility there.

I haven't looked at your QNX code yet, but I'll look tomorrow
and see how it fits in with the stuff I did.  Unfortunately, a
lot has changed since then, and the branch will probably not
merge properly.  When I've brought it back up to date, I'll
probably check it's safe and then merge it into the main branch.
I think the WIP should be released first though.

George

-- 
Random project update:
09/05/2000: Libnet 0.10.8 uploaded -- a few bugfixes
        http://www.canvaslink.com/libnet/  (try changes-0.10.8.txt)



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