Expand description
Thread counts from /proc/<pid>/stat.
sysinfo only knows a process’s threads when it refreshes every thread
as well (/proc/<pid>/task/*), which costs several reads per thread on
every sample: on a desktop with thousands of browser and Electron
threads, that is most of the collection time. The count itself is one
field of the process’s own stat file.
Structs§
- Proc
Stat - What is read from a process’s
statline.
Functions§
- read
- The thread count and nice value of
pid, from one read of itsstat. - thread_
count - Number of threads of
pid, orNoneif it is gone or unreadable.