I'm pretty sure that's not actually the case.  I'd wager that CF has
an internal thread pool, so that thread, once it's finished with it's
assigned task, just remains in the pool to be reused as needed.  This
is similar to how CF page requests work: there is a pool of sleeping
request processing threads waiting for a request to come in.  At the
end of the request, the thread is released, but it's not killed off,
it gets reused by a subsequent request.

Granted, I can't say that with any sort of empirical backing, but I'd
wager that it's correct at least at a high level.  One way to tell
would be to create a page that fires off a thread, and load that page
in the browser.  Check the server monitor.  Repeat a few more times,
and compare what happens to the thread count in the monitor.  I bet
once you get up to 5 or 10 threads, you stop seeing new threads being
created.  And actually, I think there's a setting in the CF admin that
controls this, now that I think about it.  Don't have an instance in
front of me to check, however.

cheers,
barneyb

On 10/11/07, Charles Sheehan-Miles <[EMAIL PROTECTED]> wrote:
> So here's a question.  I execute a cfthread on application startup,
> and it finishes its work.  There is no terminate because the page
> context it was called from is long gone, and I've just discovered
> that a thread can't terminate itself. it leaves the thread running,
> basically forever.  Not doing anything, but sitting there and
> identifiable in the server monitor.
>
> Has anyone looked at the impact of having lots of these lying around
> doing nothing? Any serious resource impact?
>

-- 
Barney Boisvert
[EMAIL PROTECTED]
http://www.barneyb.com/

Got Gmail? I have 100 invites.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290898
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