xref: /minix3/external/bsd/top/dist/machine/m_linuxthr.man (revision b89261ba018da33f0bd8cd05f5a1fe9e7a9c837b)
1*b89261baSDavid van Moolenbroek.SH "LINUX NOTES"
2*b89261baSDavid van MoolenbroekThe Linux port was written by Richard Henderson <rth@tamu.edu>.
3*b89261baSDavid van MoolenbroekThe CPU% calculation was brazenly stolen from the Solaris 2
4*b89261baSDavid van Moolenbroekport and should be attributed to one of the many names listed
5*b89261baSDavid van Moolenbroekin its man page.
6*b89261baSDavid van Moolenbroek
7*b89261baSDavid van MoolenbroekThe order support was stolen from the SunOS 5 port by
8*b89261baSDavid van MoolenbroekAlexey Klimkin <kad@klon.tme.mcst.ru>
9*b89261baSDavid van Moolenbroek
10*b89261baSDavid van MoolenbroekMade to work under 2.4 by William LeFebvre.
11*b89261baSDavid van Moolenbroek
12*b89261baSDavid van MoolenbroekThis version of the Linux port includes automatic thread "eliding".
13*b89261baSDavid van MoolenbroekIn Linux, a thread is treated as another process sharing the memory
14*b89261baSDavid van Moolenbroekspace (as well as file table and other resources).  Thus
15*b89261baSDavid van Moolenbroekmultiple threads appear as separate processes in most system
16*b89261baSDavid van Moolenbroekutilities (see
17*b89261baSDavid van Moolenbroek.IR clone (2)).
18*b89261baSDavid van MoolenbroekThis version of top detects child thread processes and does not
19*b89261baSDavid van Moolenbroekdisplay them separately.  Instead of displaying threads individually,
20*b89261baSDavid van Moolenbroekan extra column "THR" shows the number of thread processes for a
21*b89261baSDavid van Moolenbroekparent process.  The cpu time and percentages are added to the
22*b89261baSDavid van Moolenbroekparent.  This gives a display much closer to other thread-capable Unix
23*b89261baSDavid van Moolenbroeksystems.  However, threads are still counted as separate processes in
24*b89261baSDavid van Moolenbroekthe process summary line.
25*b89261baSDavid van MoolenbroekA process is considered a thread of its parent if the
26*b89261baSDavid van Moolenbroekfollowing values are identical to its parent: address space size,
27*b89261baSDavid van Moolenbroekresident set size, code start and end program counters, and stack
28*b89261baSDavid van Moolenbroekstart.  This heuristic can mistake a recently forked child as a thread,
29*b89261baSDavid van Moolenbroekuntil the child has either called exec or allocated space on its own.
30*b89261baSDavid van Moolenbroek
31