Re: Threads

Bruce Sherwood <[email protected]>
Newsgroups gmane.comp.python.visualpython.user
Message-ID <CAFDG03gpBvOPt4-XJLyua3uL=js42z5m_=KTMVNZiFbmL36OdA@mail.gmail.com>
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
<[email protected]> 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&#174; Conference 2012
> Save $700 by Nov 18
> Register now&#33;
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Visualpython-users mailing list
> Visualpython-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/visualpython-users
>

------------------------------------------------------------------------------
RSA&#174; Conference 2012
Save $700 by Nov 18
Register now&#33;
http://p.sf.net/sfu/rsa-sfdev2dev1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.