0
1.7kviews
Compare processes and threads. Explain user level and kernel level threads. What is the need of lightweight threads?

Mumbai University > Information Technology > Sem 6 > Distributed System

Marks: 10Marks

1 Answer
0
2views
Process Thread
Process is called heavy weight process. Thread is called light weight process.
Process switching needs interface with OS. Threads switching needs no interface with OS.
Multiple redundant process uses more resources than multiple threaded. Multiple threaded uses few resources than multiple resources than multiple redundant processes.
In multiple processes, each process operates independently of the others. One thread can read, with or even completely wipe out another threads stacks.
If one server process is blocked so other server process can execute until the first process unblocked. While one server thread is blocked and waiting, second thread in same task could run.

Threads and Threads in DS

Thread is basic unit of CPU utilization.

enter image description here

User – level Threads Kernel – level Threads
User level threads are faster to create and manage. Kernel level threads are slower to create and manage.
Implemented by a thread library at user - level OS directly supports to kernel threads.
User level thread can run on any OS. Kernel – level threads are specific to OS.

Multithreading: It is a type of execution model that allows multiple threads to execute independently but share their process resources.

Types:

1) Preemptive Multithreading

2) Co – operative Multithreading

Threads in DS

Threads provide convenient way of allowing blocking system calls without blocking the entire process in which thread is running.

This makes it attractive to use in DS as it makes it much easier to do communication in form of maintaining multiple logical connections at the same time.

Please log in to add an answer.