Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: David Butenhof <David.Butenhof@hp.com>
Subject: Re: Thread info
Date: Wed, 09 Apr 2003 08:28:21 -0400	[thread overview]
Message-ID: <3e941468@usenet01.boi.hp.com> (raw)
In-Reply-To: bbca563c.0304070500.1fc12ec4@posting.google.com

Pasquale wrote:

> Hi all,
> I have developed a multi threads application.
> Sometimes, the main process display (through ps -ef command) the cpu
> usage at 99%.
> With the command "ps m" I have analyzed the threads status and one
> thread gets the cpu at 99%, this thread is running and its status is
> "nxmidle".
> Which means this status?

The nxmidle "status" (wait channel) means that the kernel thread is idled in 
the kernel. If it's really taking CPU time in that state, there's a bug in 
the kernel. However, it's also possible that the kernel thread is dropping 
in and out of nxmidle state while you're not looking -- the rate at which 
you can type 'ps' commands is extremely slow compared to what the thread 
might be doing.

Before you spend too much more time analyzing, check your system version and 
patch level. Make sure you've at least installed all the thread related 
kernel and user patches for your version (installing ALL of every patch kit 
is even better). If that doesn't help...

Since nothing shown by 'ps' gives you any easy way to tie the activity you 
see back to your application threads, you'd be better off attaching to the 
process with ladebug; its "show thread" command will tell you what the 
application (POSIX) threads are doing, regardless of how those threads are 
currently mapped onto kernel threads.

You might also want to try running the application with the Visual Threads 
analysis tool to see what it's doing.

If you can't explain the kernel thread's activity through the behavior of 
the application, you'll need to start looking inside the kernel. For 
example, you could use "dbx -k", "set $pid=<pid>" to attach to the process 
context, and try to guess (an often frustrating and time consuming process) 
which kernel thread is involved... usually starting with a "tlist" to show 
the state of all the kernel threads in the process and eliminating the ones 
that "can't be" the troublemaker, often by examining each call stack.

-- 
/--------------------[ David.Butenhof@hp.com ]--------------------\
| Hewlett-Packard Company       Tru64 UNIX & VMS Thread Architect |
|     My book: http://www.awl.com/cseng/titles/0-201-63392-2/     |
\----[ http://homepage.mac.com/dbutenhof/Threads/Threads.html ]---/


  reply	other threads:[~2003-04-09 12:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-07 13:00 Thread info Pasquale
2003-04-09 12:28 ` David Butenhof [this message]
2003-04-10  7:48   ` Pasquale
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox