Process Vs Thread

The Process and Thread are the essentially correlated. The process is an execution of a program whereas thread is an execution of a program driven by the environment of a process.
Another major point which differentiates process and thread is that processes are isolated with each other whereas threads share memory or resources with each other.

Key Differences Between Process and Thread :

  1. All threads of a program are logically contained within a process.
  2. A process is heavy weighted, but a thread is light weighted.
  3. A program is an isolated execution unit whereas thread is not isolated and shares memory.
  4. A thread cannot have an individual existence; it is attached to a process. On the other hand, a process can exist individually.
  5. Each thread has its own stack, so if a thread dies its stack is reclaimed. In contrast, if a process dies, all threads die including the process.

Conclusion:

Processes are used to achieve execution of programs in concurrent and sequential manner. While a thread is a program execution unit which uses the environment of the process when many threads use the environment of the same process they need to share its code, data and resources. The operating system uses this fact to reduce the overhead and improve computation.

Comments

Popular posts from this blog

Reasoning Vs Inference

Frame vs Packet