[Zope] Sharing global data between threads / locking a method

Jonathan dev101 at magma.ca
Mon Jun 27 10:59:51 EDT 2005


----- Original Message ----- 
From: "Jim Abramson" <jabramson at wgen.net>


>> A possible solution:  create a property field on the folder
>> where the external methods are stored.  Have your external
>> method update this property field when the external method
>> starts and again when it exits.  This way you can test
>> whether or not the external method is currently in operation.
>>  You could store this property field on a temp_folder for
>> faster performance.
>
> Curious,
>
> - to save variables in this way, must a Folder property be used, or
> would a class variable set on something that extends Folder work the
> same?

You can store the property field on/in any zope object that can be accessed 
via the external method.


> - why does temp_folder perform faster for this technique?

'temp_folder' folders are 'temporary' and only exist in memory (objects 
stored in/on 'temp_folders' are not written to the zodb), therefore are 
faster to access, but the downside is that when zope is shutdown all 
temp_folder content is lost.

Jonathan




More information about the Zope mailing list