30

I've noticed this situation several times (but I'm not sure if it is always the same command).

I don't even know how to describe the lead-up to this situation, unless it is because of a detached script I've been testing which hasn't terminated properly...

The best I can do is present this image of htop (Tree view)... I've only shown the first few. There is a total of 63 subordinate entries (plus the 1 parent)... and t hey just sit there!

I'd like to know what is going on?... and is the "64" some kind of limit?

Whatever the case, it just seems bizzare to have 64 threads/processes "running"

Update:
I've just rebooted the system, and this time, the first thing I did was to check htop...
console-kit-daemon shows 63 threads... so It looks like this may be a normal situation... It still seems a bit strange to me... Does anyone know why there are so many threads for console-kit-daemon ?


alt text

Peter.O
  • 24,681

2 Answers2

36

Those are user threads (as opposed to processes), and you can hide them using the 'H' toggle in htop. See this explanation in its man page:

H Hide user threads: on systems that represent them differently than ordinary processes (such as recent NPTL-based systems), this can hide threads from userspace processes in the process list. (This is a toggle key.)

  • 10
    I'd like to add that this is uppercase "H", not lowercase "h" (they are not the same in htop, as I'm sure Daniel knows, but maybe not everybody else). – JanC Dec 12 '10 at 07:05
  • Thanks Daniel, I must say that I hadn't realized that they were "threads", but none the less, they each have a unique PID, and I wonder how on earth I manage to get 63/64 concurrent threads ....and why is there this apparent 64 ceiling (which I have seen and counted in at least one other situaton?.. any ideas about this? ... By the way.. when the image was captured, I had nothing running (that I know of) other than Nautilus and the Terminal and a few other standard "static" apps (eg, gedit and firefox) – Peter.O Dec 12 '10 at 08:30
  • @Peter.O - https://stackoverflow.com/questions/9305992/if-threads-share-the-same-pid-how-can-they-be-identified, good read. – dpb Apr 11 '18 at 14:24
  • is there a way to start htop with this setting? --help doesn't explain it :( – Ufos Jun 19 '20 at 10:24
9

The 60+ threads is a bugalt text with ConsoleKit.

Isaiah
  • 59,344
  • 4
    Thanks DoR... This has solved the "puzzle"... On the bug page, someone suggested to change htop's settings to not "display userland threads". I tried it, and it turns out to be the same setting as pressing H... However, because of this, I've now become aware of some of htop's useful settings; eg. Showing threads in a different colour... Highlighting the basename... and I see that kernel threads can be toggled on/off too... So, as well as learning about console-kit-daemon's unusual behavioue, this new insight into htop is a bonus :) – Peter.O Dec 12 '10 at 20:01
  • @Peter.O thank you! didn't know pressing H hides the userland threads – asgs Aug 15 '18 at 20:15