From: Rocky R. <rh...@sg...> - 2004-04-06 23:24:31
|
Thanks Brian. I probably won't have time to fool around with this for a day or two, but I'll try running the glthreads test just to make sure it works here for me and making the change you mention to xm_api.c as well. I've been looking around for a call to XInitThreads in this code, but haven't figured it out yet. I'll look some more for that when I get a chance, too. Rocky > -----Original Message----- > From: Brian Paul [mailto:bri...@tu...] > Sent: Tuesday, April 06, 2004 1:35 PM > To: Rocky Rhodes > Cc: 'mes...@li...' > Subject: Re: [Mesa3d-users] Mesa-6.0.1 and multi-threaded X11 apps > > > Rocky Rhodes wrote: > > I've got a (large) multi-threaded C++ application I'm > trying to run on an > > SGI Altix machine (IA64 Linux) with no graphics card. The > code uses OpenGL > > and glut and reputedly runs fine on many hardware/software > configurations. > > When I run it on the Altix with a Mesa-6.0.1 gl I see a > number of issues > > with Xlib. If I just run the program as is, the > application freezes after > > painting a GUI window, never painting the main OpenGL > window. If I run the > > app with a "-sync" flag for glut to run with synchronous X protocol > > transmissions, the application runs better, but still gives > me Xlib errors > > occasionally, particularly "Xlib: unexpected async reply (sequence > > 0xblahblah)!". > > > > Are there any problems using Mesa and glut with > multi-threaded apps? The > > X11R6 info seems to blame these "unexpected async reply" errors on > > multi-threaded applications improperly using Xlib concurrently. > > XInitThreads, XLockDisplay, XUnlockDisplay? > > > > Thanks for any help you may be able to provide. > > > > Rocky > > Hi Rocky, > > Hard to say what the problem is off-hand. The only threaded > test that I > regularly run is the progs/xdemos/glthreads.c test from the > Mesa distro. > It seems fine here. > > Mesa's Xlib device driver is meant to be thread-safe, but > there could be > a bug somewhere. Actually, I'm looking at the XMesaSwapBuffers() > function in src/mesa/drivers/x11/xm_api.c and see that the calls to > _glthread_LOCK/UNLOCK_MUTEX() are commented out (don't know > why). You > might try re-enabling them to see what happens. > > Does your application call XInitThreads() like the > glthreads.c program? > > I don't know if GLUT is meant to be thread-safe either. > > -Brian > |