8

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...

5 Answers 5

9

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.

2

Actually I think it's the other way around. Wikipedia says this:

In computer operating systems, a light-weight process (LWP) is a means of achieving multitasking. In the traditional meaning of the term, as used in Unix System V and Solaris, an LWP runs in user space on top of a single kernel thread and shares its address space and system resources with other LWPs within the same process. Multiple user level threads, managed by a thread library, can be placed on top of one or many LWPs - allowing multitasking to be done at the user level, which can have some performance benefits.

So LWPs share address space within the same process. In other words an LWP is a sub-process.

1
  • so can we say that in Solaris we can not create process without LWP?
    – AHF
    Feb 6 at 22:30
1

LWP == thread

Lightweight process is a denomination for threads that is still used on Solaris and on some utilities across *nix variants. (e.g. ps on Linux).

2
  • 1
    It's more complex than that though because multiple threads can run on top of an LWP. May 14, 2011 at 19:11
  • @David: no, it's not. Nothing prevents you from running e.g: multiple GNU pth threads on top of a single POSIX pthread, it's the same case.
    – ninjalj
    May 14, 2011 at 19:14
0

1.multithreading

multithrading in java is a process to execute multiple threads simultaneously..

Thread is a basically lightweight process...a smallest unit of processing..multithrading,multiprocessing both are used to achieve multitasking..

why we use multithrading and multiprocessing--because threads share a common memory area not seprate memory for indivisual threads..

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.

Multitasking

Multasking is a process to execute multiple task simultanously..we use multitasking to utilize on cpu..multitasking have two types which have to achieve.. 1.Process based multitasking(multiprocess) 2.Thrad based multitasking(Multithrading) 1.Process based multitasking(multiprocess)

each process have its own addresss in memory and allocate the seprate memory to each process..

it's a heavyweight process..

2.Thrad based multitasking(Multithrading)

Threads share the same address space.

Thread is lightweight.

what is thread..

Thread is a lightweight process..it's contain in single process but multiple threads,dependent,if there occurs exception in one thread,but not effect on other thread.

0

Thread is also called as Light-weight process, as it present in same address block as the Process and shares the code,data and the OS resources of the process with fellow threads.It cost less resources to communicate between the threads.

Heavy-weight process defines the processes running parallel to accomplish their tasks.Every process has their own data,code and OS resources and the processes requires extra resources to communicate between themselves.

Light-weight process has more advantage than Heavy-weight process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.