From: Brian P. <bri...@tu...> - 2004-04-06 21:44:54
|
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 |