13 Jan
2005
13 Jan
'05
1:15 p.m.
Jeff Rodriguez wrote:
I need to lock an object to perform thread/ZEO safe operation on one of it's attributes. How can I go about doing this?
The transaction / concurrency machinery of the ZODB makes such precautions normally unnecessary for persistent objects. Are you needing to protect a non-persistent object, e.g. a module-level global data structure? If so, Python's 'threading' module (or the lower-level 'thread' module) is your friend. See $ZOPE/lib/python/Products/StandardCacheManagers/RAMCacheManager.py for an example of such usage. Tres. -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com