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

2005-06-29 Thread Sascha Welter
(Mon, Jun 27, 2005 at 12:00:08PM -0400) [EMAIL PROTECTED] wrote/schrieb/egrapse: Message: 9 Date: Mon, 27 Jun 2005 15:53:38 +0200 From: Max M [EMAIL PROTECTED] Subject: [Zope] Sharing global data between threads / locking a method To: zope@zope.org Message-ID: [EMAIL PROTECTED] Content-Type

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

2005-06-27 Thread Max M
I have a synkronisation script that I run every 10 minutes via wget from a cron job. Sometimes the script runs longer than 10 minutes. In that case I would like to return a page to wget, but not run the actual script. So in a external method/module I have a function like this: BUSY_STATE =

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

2005-06-27 Thread Jonathan
on a temp_folder for faster performance. hth Jonathan - Original Message - From: Max M [EMAIL PROTECTED] To: zope@zope.org Sent: Monday, June 27, 2005 9:53 AM Subject: [Zope] Sharing global data between threads / locking a method I have a synkronisation script that I run every 10 minutes

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

2005-06-27 Thread Jim Abramson
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

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

2005-06-27 Thread Jonathan
- Original Message - From: Jim Abramson [EMAIL PROTECTED] 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

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

2005-06-27 Thread Pascal Peregrina
... Pascal -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de Jonathan Envoyé : lundi 27 juin 2005 17:00 À : Jim Abramson; zope@zope.org; Max M Objet : Re: [Zope] Sharing global data between threads / locking a method - Original Message - From: Jim

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

2005-06-27 Thread Jonathan
- Original Message - From: Pascal Peregrina [EMAIL PROTECTED] I think that storing an isMyProcessingStarted property would not work, because the transaction that modifies the property value would not be committed until the long processing is done, so when the next transaction that

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

2005-06-27 Thread SER.RI-TIC-Alexis Roda
Jonathan wrote: 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

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

2005-06-27 Thread Dieter Maurer
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.

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

2005-06-27 Thread Dieter Maurer
Jonathan wrote at 2005-6-27 11:33 -0400: ... I am not sure when changes are made to 'temp_folder' objects as they are not committed to the zodb (ie. do changes to temp_folder objects happen immediately or are temp_folder changes also tied in to the committment machinery)? They are (tied to