I ran the program pstree -p 31872 which printed the following output:
ruby(31872)─┬─{ruby}(31906) └─{ruby}(32372) The man page for pstree says:
Child threads of a process are found under the parent process and are shown with the process name in curly braces, e.g.
icecast2---13*[{icecast2}]
(The above is displayed differently because of the missing -p option, which disables compaction.)
Running pstree 31872 without -p gives:
ruby───2*[{ruby}] When I try to observe those PIDS using ps, no results are found. However, the pids, exist in /proc.
My question is, why would threads have different pids? I would expect them to be the same (31872) as the process. The same behavior is observed when running htop.