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.
Functions§
- thread_
count - Number of threads of
pid, orNoneif it is gone or unreadable.