From: Fred Y. <fr...@on...> - 2001-03-24 13:39:05
|
As I've mentioned before, I've got a VPython/Tk program that hangs on my machine, a dual Pentium3 800 system running WinNT4 SP6. Others have tried to recreate my problem, but none have seen it. I've found that with one small change to the C++ code for VPython itself, I can prevent the deadlock without seeming to cause any other problems. Here's the patch: --- displaylist.cpp.orig Sat Mar 24 07:09:58 2001 +++ displaylist.cpp Sat Mar 24 07:12:11 2001 @@ -143,7 +143,7 @@ void DisplayObject::remove() { if (prev) { - DisplayObject::read_lock P(prev->mtx); + //DisplayObject::read_lock P(prev->mtx); prev->next = next; } if (next) { -- I've simply disabled the first 'read_lock' in the DisplayObject::remove() method. I came to this because my application always seems to hang at the point where it sets the 'visible' attribute of an object to false, and this function is called in response to that action. So, is there something wrong with the locking scheme in cvisual, or am I just hacking around a deeper problem such as some glitch in display drivers? I admit that I know nothing about OpenGL, much less about what locking strategy is necessary. I don't even understand how there can be contention in my application since all work would seem to be done in the Tk thread in response to callback functions associated with the Slider objects. But here too, I don't understand just what threads are involved and how they can interleave. It does bother me that the insert() and remove() methods of DisplayObject both create two locks, not releasing the first one before acquiring the second even though the first seems no longer to be needed when the second is acquired. I tried hacking the code to explicitly delete the first lock as soon as possible, but that version still deadlocks. My problematic application is still at <http://www.ontosys.com/src/residue.py>. Here's the output from glinfo.py, showing my private version of cvisual.dll. My video card is a 3Dfx Voodoo-3 3000 16MB AGP, set at 1600 x 1200 x 32 at 85 Hz: -- $ python glinfo.py Visual-2001-02-27 e:\programs\python20\dlls\cvisual.dll Sat Mar 24 07:12:18 2001 e:\programs\python20\visual\__init__.py Tue Feb 27 21:58:28 2001 e:\programs\python20\visual\graph.py Tue Feb 20 20:35:42 2001 d:\winnt\system32\opengl32.dll Thu Nov 18 10:04:00 1999 OpenGL renderer active. Vendor: Microsoft Corporation Version: 1.1.0 Renderer: GDI Generic Extensions: GL_WIN_swap_hint GL_EXT_bgra GL_EXT_paletted_texture -- Fred Yankowski fr...@On... tel: +1.630.879.1312 Principal Consultant www.OntoSys.com fax: +1.630.879.1370 OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA |