i dont think so. there is no point in running multiple threads of a
process, if you dont need them. finding them and not running them is
the best thing in my view anyways.
Correct.... Dont spawn unnecessary threads and run into the overhead of
synch problems!! What context are you exactly trying to kill threads ?
U could probably monitor the number of threads u are spawning using
some static variable and shutdown the thread based on that count and
decrement the counter
(Please learn to quote enough context so that a message
can stand alone and still make sense. For those who may not
have seen the beginning of the thread, sconeek asked how to
kill all his program's threads except one, and I offered the
opinion that such an action would be both silly and dangerous.
We now resume our story ...)
> i dont think so. there is no point in running multiple threads of a
> process, if you dont need them. finding them and not running them is
> the best thing in my view anyways.
Well, then, I suggest you perform the experiment for yourself.
Launch a Java program that will run for a fairly long time, and
kill off the "unnecessary" threads with system-specific ad-hoc
methods -- for example, maybe you can run the JVM under control
of a debugger and use the debugger's commands to nail the threads.
If the experiment is a success, you can then go on to look for
more convenient ways to arrange the assassinations. Good luck!

Signature
Eric Sosman
esosman@acm-dot-org.invalid