[Deploying Sakai] killing threads

R.P. Aditya rpaditya at umich.edu
Wed Oct 28 18:37:29 PDT 2009


On 2009-10-28, Charles Hedrick <hedrick at rutgers.edu> wrote:
> Java thread ID, as opposed to the OS thread ID used so far

you can also get the Java thread Id as well as the cpu consumption
directly from the JVM SNMP agent using the oids:

jvmThreadInstId
jvmThreadInstName
jvmThreadInstCpuTimeNs

(there are other useful oids too for finding block and wait times...)

>                        thread.stop();
...
> where NNN is the Java thread ID
>
> I just did this on three different JVMs, suffering from two different  
> kinds of loop. It either killed or stopped all the threads.

however Thread.stop() is considered unsafe:

  http://stackoverflow.com/questions/1102094/killing-thread-instantly-in-java

and even Sun's own disclaimer:

  http://java.sun.com/j2se/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html

which is why I've never even attempted it...

Adi



More information about the production mailing list