Unfortunately, the standard Python package has something called a GIL, or global interpreter. This means that only one of your threads will work at a time. At the same time, simple multi-threaded applications are possible and quite easy to write. The streaming module contains basic synchronization primitives such as mutexes, sempahores, etc.
There is also a wonderful instruction manual that automates most aspects of locking. For example:
import threading
myLock = threading.Lock()
Then to use the lock:
with myLock:
print "I have the lock and can now to fun stuff"
print "The lock has been released"
source
share