3

I'm observing a multi threaded process in htop in tree view. If I were to strip it just to the problematic part, it looks somewhat like this:

                  CPU%
 bin/process       100
  `- thread1        70
  `- thread2         0

The process all together is using 100% and one of the threads is using 70%. Where do I place the other 30%?

2 Answers 2

4

thread1 and thread2 are child threads spawned by the main process but the main process can still do work.

In your output of htop bin/process (and all child threads) are using 100% of cpu. 70% of the cpu is used by thread1 and 0% by thread2, the remaining (difference) is the main process that spawn/manages these child threads.

-2

The 1st coloumn of the same row(at the extreme left) of the thread it will show the ID of the thread. grep that thread ID in the output of ps -eLf and you will see the thread.

Remember, you have to use the options -eLF to include the threads in the output.

From man ps :

 -L              Show threads, possibly with LWP and NLWP columns
1
  • completely irrelevant to question Feb 18, 2016 at 1:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .