Difference between process and thread

1.A process is an instance of a computer program that is being executed. It contains the program code and its current activity. A thread is the smallest unit of processing that can be performed in an OS.

2.Process is considered heavy weight. Thread is considered light weight.

3.Process is unit of CPU utilization. Thread is unit of Resource Allocation and of protection.

4.Process do not share file descriptors. Thread can share file descriptors.

5.Process creation is very costly in terms of resources. Thread creation is very economical.

6.Program executing as process are relatively slow. Programs executing using thread are comparatively faster.

7.Process cannot access the memory area belonging to another process. Thread can access the memory area belonging to another thread within the same process.

8.Process switching is time consuming. Thread switching is faster.

9.One Process can contain several threads. One thread can belong to exactly one process.

10.Process do not share signal handling. Threads can share signal handling.

Process, Kernel Thread and User Thread

Process, Kernel Thread and User Thread

There are some differences:

  1. User level thread has low overhead, kernel level thread has medium overhead and process has high overhead.

  2. User level threads are faster than kernel level threads faster than process.

  3. Process scheduling and kernel thread scheduling done by Operating System and user level thread scheduling done by user thread library.

  4. Blocking a process can not affect other process, similarly blocking a kernel level thread does not affect other kernel level threads; however, blocking a user level thread block whole process of the user level threads.

  5. Communication between processes need OS support, similarly communication between kernel level threads also needs OS support; however communication between user level threads does not require any support from Operating System.