What is difference between Process, Thread and Task?


Process

  • A process is a program in execution.
  • Every process has its own address space.
  • A process refers to the concurrently running entity on the system with tight protection.
  • processes interact only through system-provided inter-process communication mechanisms.
  • processes are typically independent.

Threads

  • A thread is just an independent execution (trace) through the code of a process.
  • In order to create threads, first you need a virtual address space, which is instantiated when the process is created.
  • Threads are also called as light weight process ( because they don’t need separate resource allocation ) .
  • Threads have full access to utilize it’s parent process resources (also termed as loose protection).
  • Threads refers to the concurrently running entity within the process.
  • Threads uses address spaces of the process.

Task

  • A task refers to the concurrently running entity on the system with loose protection.
  • A task is simply a set of instructions loaded into the memory.
  • A task needs a thread to execute.
  • A specific instance of executable code and its data environment.