Listing the running threads

L

Lekeas GK

Hi All,

Does anyone know whether there is a way to get a list with all the running
threads?

I look forward to hearing from you soon.

Thanks in advance.

George
 
R

Robert Olofsson

Lekeas GK ([email protected]) wrote:
: Hi All,
: Does anyone know whether there is a way to get a list with all the running
: threads?

There are a few ways. Thread and ThreadGroup have the information you need.
Thread.getThreadGroup(), ThreadGroup.getParent () and
ThreadGroup.enumerate () should give the info you want.

You can also press some key like Control-Break (depending on jdk and os,
check the docs) to get a thread dump on the console.
Many debuggers and/or profilers can also show the current threads
and the method stacks.

/robo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top