From: BKBK on
[i]I did a few more tests today and noticed the queued threads total
decreasing, 10 threads a time. At some point, it reached zero, so they do get
processed at some point. However, once my queued threads reached 0, I still had
104 threads running and it remained like that until I restarted the service in
which it reset to 0.[/i]

Threads are the proverbial can of worms. Leave the lid open, and they're all
over the place.

[i]Is calling a terminate at the end of the thread make this possible or
simply making the thread run its course?[/i]

The terminate action of the cfthread tag instructs Coldfusion to stop
processing the thread.

[i]My goal is to write a small daemon thread that limits the number of threads
running. [/i]

I get the feeling that might be risky. I would leave that kind of control over
to Coldfusion. See what you can do with the settings on the page Server
Settings => Request Tuning in the Administrator.



From: sk8save on
What I should have said was that I want to limit the amount of very specific threads that my own application launches - I'm on a corporate shared environment.
From: BKBK on
I don't know how to place a global limit on threads without involving the
Coldfusion Administrator. I wonder whether it's even possible. It involves some
complexity. All requests involve threads, and there are thread groups, for
example, web and jrun. In my opninion all you can, and should, do is make sure
that your application's threads come to a graceful and timely end, and that
they consume minimal memory.



From: sk8save on
Not sure if this clears things up but all of this is related to the tag cfthreads, those are the ones I want to limit/control in my app.
From: BKBK on
The only facility I know of in cfthread is to call the terminate action on a named thread.