Re: Threads

Jerzy Karczmarczuk <[email protected]>
Newsgroups gmane.comp.python.visualpython.user
Organization UCBN
Message-ID <[email protected]>
James Mueller  :
> One point is that rate and sleep have different purposes.
>
> rate is trying to make sure that each iteration of the loop takes a 
> time slp.  So to get the same effect from sleep, you would need to 
> call time.sleep(slp-delta), where delta is the amount of time taken by 
> the instructions in the rest of the loop.
>
OK, but doesn't matter.
Some simple instructions in Python don't take much time. (And if the 
rendering thread is autonomous, it doesn't waste the time of the main 
process.
If in my cited program you eliminate all waiting, the process terminates 
before you are able to see any movement.

Who will need an incredibly fine tuning while programming in Python?

You may make some variants, if you wish, e.g. introduce into a loop a 
timing block which measures the time lapse /since its last call/, and 
wait until your "rate" condition is fulfilled.
Clumsy...

==
The problem is the thread safety. The sleep() call *is* a replacement 
for rate(), that's all I wanted to say.

Thank you for your reaction.
Best regards.

Jerzy Karczmarczuk

------------------------------------------------------------------------------
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
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.