What is Thread in Operating System?
First of all you should know that a thread is also known as lightweight process.
It is a sequence of instruction within a process. A thread itself behave like a processes in a process.
It behave like a process within the process, but it don’t have a complete PCB it relays on the PCB of the process under which it is behaving like a process.
A process can have multiple threads, all those multiple threads in the process help the process to perform multiple executions which improves the working.
There must be at least one thread in a process.
A thread pass through three states:
- Running
- Ready
- Blocked
Benefits of Threads:
It share common data and do not use the Inter process communication.
Speed improvement when multiple threads cooperate to complete a single job.
Context switching becomes fast when working with threads.
Threads use very little recourses of OS as they don’t demand complete separate PCB.
It share common data and do not use the Inter process communication.
Speed improvement when multiple threads cooperate to complete a single job.
Context switching becomes fast when working with threads.
Threads use very little recourses of OS as they don’t demand complete separate PCB.