bitly/asyncmongo — Issue #36: thread safety
Author: steamraven
Created: 2012-01-11 21:07:11+00:00
State: open

The connection decrement in ConnectionPool.cache() is NOT thread safe (asyncmongo/pool.py: 129)

It probably needs to be in the lock.

http://effbot.org/pyfaq/what-kinds-of-global-value-mutation-are-thread-safe.htm
http://mail.python.org/pipermail/python-dev/2006-November/thread.html#69981
http://www.velocityreviews.com/forums/t632419-atomic-increment.html