¡@

Home 

python Programming Glossary: shared_balance

Are locks unnecessary in multi-threaded Python code because of the GIL?

http://stackoverflow.com/questions/105095/are-locks-unnecessary-in-multi-threaded-python-code-because-of-the-gil

code. For example # usr bin env python import threading shared_balance 0 class Deposit threading.Thread def run self for _ in xrange.. def run self for _ in xrange 1000000 global shared_balance balance shared_balance balance 100 shared_balance balance class.. self for _ in xrange 1000000 global shared_balance balance shared_balance balance 100 shared_balance balance class Withdraw threading.Thread..