RE: [Zope] Sharing global data between threads / locking a method
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? - why does temp_folder perform faster for this technique? Thx Jim
----- Original Message ----- From: "Jim Abramson" <jabramson@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
participants (2)
-
Jim Abramson -
Jonathan