[ZODB-Dev] Objects shared across transactions (requests)

Steve Alexander steve@cat-box.net
Wed, 19 Sep 2001 18:47:02 +0100


Sergey Konozenko wrote:

> 
> My questions:
> 1) What I need is a way to share the same object between transaction threads
> so that it's method(s) can use locks to write to external resources or do
> some other processing in an atomic way (without being interrupted by similar
> requests from other threads).


Look at how the Zope RAM Cache Manager does this. Basically, it stores 
the information and the read/write locks as members of a module. Thus, 
it is shared across all the threads in a single Zope.

It may not be a good solution if you want to share things in this way 
using ZEO, as there will be a number of different python interpreters 
involved.

--
Steve Alexander
Software Engineer
Cat-Box limited