On Sun, Sep 21, 2008 at 10:50 AM, Mike C. Fletcher <firstname.lastname@example.org>
Most GUI libraries are inherently single-threaded. You can often get around the problem by *first* importing the GUI library in the GUI thread (i.e. *not* in the main thread). That is, the first time GLUT (or wx, or Tk, or any GUI lib I've seen recently) is imported needs to be within the GUI thread so that it will create its global state inside that thread, rather than the main thread.
Alexandre Lacoste wrote:
First : Many thanks for this great python bindings !!
I'm trying to thread my opengl class but it is not working. I get segmentation fault at glutInit or glutInitDisplayMode
here is the simplest example I was able to build. It never gets to the : print "end" part.... It seg fault before.
The attached version of the code runs fine on my machine. The only change is to move *all* imports of GLUT into the background/GUI thread by separating it out into a separate module. You may want to set up a few queues to transfer data in the call to "run" so that your two threads can communicate easily.
Mike C. Fletcher
Designer, VR Plumber, Coder