Popular recipes by John E. Barham http://code.activestate.com/recipes/users/100938/2001-08-08T18:06:31-07:00ActiveState Code RecipesThread-specific storage (Python)
2001-08-08T18:06:31-07:00John E. Barhamhttp://code.activestate.com/recipes/users/100938/http://code.activestate.com/recipes/66429-thread-specific-storage/
<p style="color: grey">
Python
recipe 66429
by <a href="/recipes/users/100938/">John E. Barham</a>
(<a href="/recipes/tags/threads/">threads</a>).
Revision 2.
</p>
<p>The get_thread_storage() function described below returns a thread-specific storage dictionary. (It is a generalization of the get_transaction() function from ZODB, the object database underlying Zope.) The returned dictionary can be used to store data that is "private" to the thread.</p>