Threads

From LQWiki
Jump to navigation Jump to search

A thread is an independently-executing portion of a Process. In other words, it shares all of the memory, open files, and other resources owned by the process to which it belongs, but it executes independently of all other threads within the same process. (Note: a "process" always consists of at least one "thread.")

In Linux versions prior to version 2.6, using the so-called linuxthreads system, the various threads within a process would show up separately in the output of the ps command.

Linux 2.6 introduced the NPTL (New Posix Threading Library) system, which greatly improves the handling and performance of threads and also causes threads to no longer show up individually in the output of ps.