1

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%?

1

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.

-1

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
  • completely irrelevant to question – imagineerThis Feb 18 '16 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.