Max M wrote at 2005-6-27 15:53 +0200:
> ...
>So in a external method/module I have a function like this:
>
>BUSY_STATE = 0
>def sync_in_progress(busy=None):
>     global BUSY_STATE
>     if busy is None:
>         return BUSY_STATE
>     else:
>         BUSY_STATE = busy

Note that this is likely to fail.

The module containing an External Method is maintained in the
ZODB cache. As a consequence, each worker gets its own copy
and you cannot synchronize via global variables of such modules.

Use a true Python module (note that Zope does not import
the source file of an External Method; therefore, it is
not inside a module in the Python sense) when you need
synchronization via global module level variables.

-- 
Dieter
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to