Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need to find thread status in Solaris

640 views
Skip to first unread message

kamit28

unread,
Jun 9, 2009, 5:37:21 AM6/9/09
to
Hi all,

Is there a way, any command etc., that can be used to see a thread
status just like we get process status using ps, top and prstat
commands?

Actually, my java program spawns threads for some data load process.
Some times it takes too much time and in these cases I need to find
the status of the threads, like how much memory it is consuming etc.
And if possible kill the thread. Can I do this?

My OS is Solaris 9.

Thanks & Regards,
Amit

Stefaan A Eeckels

unread,
Jun 9, 2009, 5:06:39 PM6/9/09
to
On Tue, 9 Jun 2009 02:37:21 -0700 (PDT)
kamit28 <kam...@gmail.com> wrote:

> Is there a way, any command etc., that can be used to see a thread
> status just like we get process status using ps, top and prstat
> commands?

prstat -L will show all LWPs (threads) individually. pstack and pflags
report on individual LWPs, but the Solaris 9 versions don't allow you
to stipulate the thread number (you can in Solaris 10).

> Actually, my java program spawns threads for some data load process.
> Some times it takes too much time and in these cases I need to find
> the status of the threads, like how much memory it is consuming etc.
> And if possible kill the thread. Can I do this?

Not with system tools - the only object you can kill is a process.
If you want to "kill" a thread you'll need to provide the facility in
your program. For example, the thr_kill(2) call sends a signal to (aka
"kills") a thread, but it can only be called from the process itself.
The thread will obviously need to include code to handle the signal.

--
Stefaan A Eeckels
--
Governments are like babies: digestive tracts with a big appetite at
one end and no sense of responsibility at the other. The better run
ones from time to time get clean diapers...

kamit28

unread,
Jun 10, 2009, 4:53:35 AM6/10/09
to
On Jun 10, 2:06 am, Stefaan A Eeckels <hoend...@ecc.lu> wrote:
> On Tue, 9 Jun 2009 02:37:21 -0700 (PDT)
>

Thanks Stefaan.

kartikvashishta108

unread,
Jun 10, 2009, 11:19:13 PM6/10/09
to
0 new messages