Light-weight process
From Wikipedia, the free encyclopedia
In computer operating systems, a light-weight process (LWP), confusingly known as a kernel thread, is a means of achieving multitasking. In contrast to a user thread, which is handled at the application level, a light-weight process is scheduled by the kernel. For this reason, they are generally preferred over a userland thread implementation whenever possible, as there is usually much less overhead.
On most systems, a light-weight process also differs from a full-blown process, in that it only consists of the bare minimum execution context and accounting information that is needed by the scheduler, hence the term light-weight. Generally, a process refers to an instance of a program, while a LWP simply represents a thread. Since a thread does not need as much state information as a process, a light-weight process does not carry such information.
LWPs however do share most of the process resources, which means that in some implementations using multiple processes can be needed, to for instance avoid memory leaks (a process can be replaced by another one) and privilege separation (processes can run under other credentials and have other permissions). Using multiple processes also allows the application to more easily survive if a process of the pool crashes or is exploited.