views:

39

answers:

1

Hi,

I am assigning task randomly to threads,and at a specific time how to get the task name running on a particular thread.Please anyone help me.

A: 

I am not fully sure what you are asking but jstack will show you what sections of code your threads are working in. This will show you what code your threads are executing.

If you want to know what names are running keep a reference to all your tasks and have a method in them printing out the thread they are running in.

EDIT: jps will display all the java applications running on your system.

type jstack followed by the id for your application returned by jps.

Thats it really.

Paul Whelan
Please,Can you give some sample code to work with jstack
Rajapandian