What is the difference between lwp and threads?

Source: Internet
Author: User

This explains the difference between lwp-process-thread:

A light-weight process (lwp)
Is a means of achieving multitasking. in contrast to a regular (full-blown) process, an lwp shares all (or most of) its logical address space and system resources with other process (es ); in contrast to a thread, a light-weight process has its own private process
Identifier and parenthood relationships with other processes. moreover, while a thread can either be managed at the application level or by the kernel, an lwp is always managed by the kernel and it is scheduled as a regular process. one significant example
Of a kernel that supports lwps is the Linux kernel.

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 schedight, hence the term light-weight.
Generally, a process refers to an instance of a program, while an lwp represents a thread of execution of a program (indeed, lwps can be conveniently used to implement threads, if the underlying kernel does not directly support them ). since a thread of execution
Does not need as much state information as a process, a light-weight process does not carry such information.

As a consequence of the fact that lwps share most of their resources with other lwps, they are unsuitable for certain applications, where multiple full-blown processes are
Needed, e.g. to avoid memory leaks (a process can be replaced by another one) or to achieve privilege separation (processes can run under other credentials and have other permissions ). using multiple processes also allows the application to more easily keep ve
If a process of the pool crashes or is exploited.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.