* Thread info
@ 2003-04-07 13:00 Pasquale
2003-04-09 12:28 ` David Butenhof
0 siblings, 1 reply; 3+ messages in thread
From: Pasquale @ 2003-04-07 13:00 UTC (permalink / raw)
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?
Thanks for yours answers.
Bye, Pasquale.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Thread info
2003-04-07 13:00 Thread info Pasquale
@ 2003-04-09 12:28 ` David Butenhof
2003-04-10 7:48 ` Pasquale
0 siblings, 1 reply; 3+ messages in thread
From: David Butenhof @ 2003-04-09 12:28 UTC (permalink / raw)
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 ]---/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-04-10 7:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-07 13:00 Thread info Pasquale
2003-04-09 12:28 ` David Butenhof
2003-04-10 7:48 ` Pasquale
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox