RE: Long running process - cflock & cfthread
Thanks for this. Actually the earlier response made me forget about the cleverness of cfthread in this situation and look at just using cflock which I think does the trick perfectly well. Regards Richard > -Original Message- > From: Rich Kroll [mailto:[EMAIL PROTECTED] > Sent: 28 July 2008 03:25 > To: CF-Talk > Subject: Re: Long running process - cflock & cfthread > > You could use java to manage this, take a look at creating a "guarded > block": > > http://java.sun.com/docs/books/tutorial/essential/concurrency/ > guardmeth.html > > HTH, > Rich > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309783 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Long running process - cflock & cfthread
You could use java to manage this, take a look at creating a "guarded block": http://java.sun.com/docs/books/tutorial/essential/concurrency/guardmeth.html HTH, Rich ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309782 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Long running process - cflock & cfthread
Easiest way I can see, if wrap a named around the process, with a 5 second timeout, and tell it not to throw an exception on timeout. Why use cfthread, if you are already in a scheduled task already? Mark On Mon, Jul 28, 2008 at 4:00 AM, Richard Meredith-Hardy <[EMAIL PROTECTED]> wrote: > Dear all > > My CF8 app has a scheduled event going off every 15 mins, for the > purposes of explanation I'll call this RAPID > > One thing it has to do can be very long running, up to a couple of hours > (no, it's not my code, but all to do with the response time from a > crappy old Sage line 100 accounts program). I'll call this XSLOW. > > Ideally, what I would like to do is for RAPID to look to see if XSLOW is > not running, and kick it off in a separate thread on a sort of > fire-and-forget basis, but I don't want any other instances of XSLOW > kicking off until it's finished. > > I could do this with some sort of external flag, but if XSLOW hangs or > the server gets rebooted or something there's the risk that XSLOW and > its flag will get out of synch and never run again. > > Can CFTHREAD somehow be scoped in the application scope so RAPID can > check for XSLOW's thread status every time it runs? > > I'm thinking that some sort of combination of CFTHREAD and CFLOCK will > do the trick, but I'm at a bit of a loss to see the exact way to do it. > > Thanks > > Richard > > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309773 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Long running process - cflock & cfthread
Dear all My CF8 app has a scheduled event going off every 15 mins, for the purposes of explanation I'll call this RAPID One thing it has to do can be very long running, up to a couple of hours (no, it's not my code, but all to do with the response time from a crappy old Sage line 100 accounts program). I'll call this XSLOW. Ideally, what I would like to do is for RAPID to look to see if XSLOW is not running, and kick it off in a separate thread on a sort of fire-and-forget basis, but I don't want any other instances of XSLOW kicking off until it's finished. I could do this with some sort of external flag, but if XSLOW hangs or the server gets rebooted or something there's the risk that XSLOW and its flag will get out of synch and never run again. Can CFTHREAD somehow be scoped in the application scope so RAPID can check for XSLOW's thread status every time it runs? I'm thinking that some sort of combination of CFTHREAD and CFLOCK will do the trick, but I'm at a bit of a loss to see the exact way to do it. Thanks Richard ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309768 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4