Is the following assertion true about the above question?
Lightweight processes contain a single process but multiple threads
Heavyweight processes can contain multiple subprocesses
I know there's much more to it than that, but I was wondering if this would pass as a very very basic understanding of heavyweight and lightweight processes...
Lightweight processes contain a single process but multiple threads. Heavyweight processes can contain multiple subprocesses. It doesn't block the user because threads are independent and you can perform multiple operations at same time.
Lightweight processes (LWPs) bridge the user level and the kernel level. Each process contains one or more LWP, each of which runs one or more user threads. (See Figure 1-1.) The creation of a thread usually involves just the creation of some user context, but not the creation of an LWP.
Threads are sometimes called lightweight processes because they have their own stack but can access shared data. Because threads share the same address space as the process and other threads within the process, the operational cost of communication between the threads is low, which is an advantage.
One example of a heavyweight thread is the average UNIX process, where processors may need to access more resources, and switch time may be greater, than with some other kinds of threads in different operating system environments.
A normal process under an Operating System (OS) is a heavy-weight process. For each such process, the OS provides an independent address space, this way keeping different users and services separated. Switching from one such process to another is time consuming, though modern machines contain a special unit, the Memory Management Unit (MMU), dedicated to the task. A Light-Weight Process (LWP), also called thread, runs under the address space of a normal (heavy-weight) process, and LWPs under the same process may share e.g. variables. Switching from one LWP to another is much faster than switching from one heavy-weight process to another, because there is less to manage, and the MMU is not involved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With