1*10dd2532Schristos.SH "LINUX NOTES" 2*10dd2532SchristosThe Linux port was written by Richard Henderson <rth@tamu.edu>. 3*10dd2532SchristosThe CPU% calculation was brazenly stolen from the Solaris 2 4*10dd2532Schristosport and should be attributed to one of the many names listed 5*10dd2532Schristosin its man page. 6*10dd2532Schristos 7*10dd2532SchristosThe order support was stolen from the SunOS 5 port by 8*10dd2532SchristosAlexey Klimkin <kad@klon.tme.mcst.ru> 9*10dd2532Schristos 10*10dd2532SchristosMade to work under 2.4 by William LeFebvre. 11*10dd2532Schristos 12*10dd2532SchristosThis version of the Linux port includes automatic thread "eliding". 13*10dd2532SchristosIn Linux, a thread is treated as another process sharing the memory 14*10dd2532Schristosspace (as well as file table and other resources). Thus 15*10dd2532Schristosmultiple threads appear as separate processes in most system 16*10dd2532Schristosutilities (see 17*10dd2532Schristos.IR clone (2)). 18*10dd2532SchristosThis version of top detects child thread processes and does not 19*10dd2532Schristosdisplay them separately. Instead of displaying threads individually, 20*10dd2532Schristosan extra column "THR" shows the number of thread processes for a 21*10dd2532Schristosparent process. The cpu time and percentages are added to the 22*10dd2532Schristosparent. This gives a display much closer to other thread-capable Unix 23*10dd2532Schristossystems. However, threads are still counted as separate processes in 24*10dd2532Schristosthe process summary line. 25*10dd2532SchristosA process is considered a thread of its parent if the 26*10dd2532Schristosfollowing values are identical to its parent: address space size, 27*10dd2532Schristosresident set size, code start and end program counters, and stack 28*10dd2532Schristosstart. This heuristic can mistake a recently forked child as a thread, 29*10dd2532Schristosuntil the child has either called exec or allocated space on its own. 30*10dd2532Schristos 31