From: Bruce S. <Bru...@nc...> - 2011-11-02 02:21:14
|
I don't feel terribly competent concerning the threading aspects of VPython and have no ready explanation of what you've observed about sleep and rate. However, I have reason to expect that generally speaking, using the threading module should work okay, as you've found, because I believe that's all within the Python machinery. In contrast, the rendering thread that runs about 30 times per second shuts down Python completely while rendering is in progress. Bruce Sherwood On Tue, Nov 1, 2011 at 5:21 PM, Jerzy Karczmarczuk <jer...@un...> wrote: > Does anybody has some experience with multithreading and VPython? > Standard examples are silent, the tutorial just mentions that the > rendering thread is separate > > I did some simple tests (with the threading module without any locks, > some "planets" wandering concurrently on the screen), no serious > problems, but if somebody tried some torture example, and noticed > something, I would be grateful to know. > > I noticed something I cannot interpret. Two objects move, and two loops > running in different threads execute time.sleep(slp). Nothing wrong. I > replace the sleeping by rate(1.0/slp), and the second thread waits until > the first terminates. Why? > > Maestro Bruce? > > All the best. > > Jerzy Karczmarczuk > Caen, France. > > > ------------------------------------------------------------------------------ > RSA® Conference 2012 > Save $700 by Nov 18 > Register now! > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |