What is the difference between a process and a thread? | Real World Example

Process: 
  1. A process is a heavyweight process.
  2. A process is a separate program that has separate memory, data, resources etc.
  3. A process is created using fork() method.
  4. Context switch between the process is time-consuming. 
Example:
opening any browser (Mozilla, Chrome, IE). At this point, a new process will start to execute.
Threads:
  1. Threads are lightweight processes.Threads are bundled inside the process.
  2. Threads have a shared memory, data, resources, files etc.
  3. Threads are created using clone() method.
  4. Context switch between the threads are not much time consuming as Process.
Example:
Opening multiple tabs in the browser. 


Real world example for Process and Thread This will give you the basic idea about thread and process 
enter image description here

Comments