Hello is this thing on?

Raymond Camden wrote:
> On Mon, Jul 7, 2008 at 1:06 PM, Ian Skinner <[EMAIL PROTECTED]> wrote:
>   
>> Is anybody using <cfthread...> functionality?  Is it working well for you?
>>     
>
> Yep.
>   
How are you using it?  Are there praticle limits on how many threads to 
create, how long thread generating code can be running?  Other factors 
to 'over using' this thread tool?

>   
>> I have been fighting for most of a month with <cfthread...>
>> functionality and it is driving me batty.
>>     
>
> cfthread is a VERY powerful tool. It also takes a lot of care to use 
> correctly.
>   
Any pointers on what these cares might be?

>   
>> Run the application one time and it does all the processing, but does
>> not output the results.
>>     
>
> That is expected. The output is stored in the thread scope for the
> thread itself. If you use the JOIN action (Which basically means, wait
> for these threads to end), you can get the output and look at it. This
> should be documented. (And let me add - be sure you have read the docs
> COMPLETELY!)
>   
I have read the documents several times.  I understood the relationship 
between threads and output.  The output I was refering to was after the 
join statement and consisted of a "Done" string and a dump of the 
'cfThread' structure.  I freely admit I do not completely understand all 
the ins-and-outs which is why I am experimenting.  But I have been very 
frustrated in that my attempts do not seem to yield predictable and 
repeatable results.

>
>   
>> Run it a second time and the system locks up and ColdFusion services
>> must be cycled.
>>     
>
> Most likely it is something in your code.
>
>   
>> Error trapping seems to be a crap shoot.
>>     
>
> Nope it isn't. Again, if you look at the thread data (if you use JOIN)
> you can determine if an error was thrown. Or you can use try/catch to
> log any errors.
>
> It is your responsibility to monitor what happens in the threads.
>
>   
>> If anything goes wrong in any of the spawned threads and all is lost.
>> Again ColdFusion has to be cycled.
>>     
>
> Nope. See above. :)
>   

What could I add to the following thread to prevent it from generating 
hung threads that often require a service restart to clear?

    <cfthread name="batchRenew_thread#i#" threadIndex="#i#" 
threadPathDate="#pathDate#" action="run">
    <cfset var vRenewalReport = "">

    <cftry>
        <cfoutput>#threadIndex#: #threadPathDate#</cfoutput>
       
        <cfset thread.foobar = threadIndex & ": " & threadPathDate>
   
        <cfcatch type="any">
            <cflock name="treadLogLock" timeout="5" type="exclusive">
                    <cfset thread.cfcatch = duplicate(cfcatch)>
            </cflock>
        </cfcatch>
    </cftry>
    </cfthread>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:308744
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to