sys.setcheckinterval query

Anand Pillai pythonguy at Hotpop.com
Sun Jul 20 16:55:18 EDT 2003


Quoting from documentation on sys module in python
standard documentation.

"""
setcheckinterval(interval)
 Set the interpreter's ``check interval''. This integer value
determines how often the interpreter checks for periodic things such
as thread switches and signal handlers. The default is 10, meaning the
check is performed every 10 Python virtual instructions. Setting it to
a larger value may increase performance for programs using threads.
Setting it to a value <= 0 checks every virtual instruction,
maximizing responsiveness as well as overhead.
"""
 I have a program that uses multiple threads. Is there any direct
correlation
between the number of threads my program might spawn and the value of
ther
'interval' variable.

 I am interested in the last but one statement which says, "Setting it
to a larger value may increase performance for programs using
threads.". So my question is what would that value be? How can I find
out the number of
python 'virtual instructions' for every function I have?

Thanks

~Anand




More information about the Python-list mailing list