Concurrency Tips & Tricks
Use with statement to manage locks
Starting in Python 2.5, the with statement is a far easier way to manage locks:
This is equivalent to:
Adjust checkinterval
Increasing the check interval may improve performance for CPU-bound multithreaded programs, at the cost of I/O responsiveness.