Concurrency:

  • Concurrency is achieved through the interleaving operation of processes on the central processing unit (CPU) or in other words by the context switching.
  • An application that is processing more than one task at the same time.
  • Concurrency is an approach that is used for decreasing the response time of the system by using the single processing unit.
  • Concurrency creates the illusion of parallelism, however actually the chunks of a task aren’t parallelly processed, but inside the application, there are more than one task is being processed at a time.

Parallelism:

  • An application where tasks are divided into smaller sub-tasks that are processed simultaneously or parallel.
  • It is used to increase the throughput and computational speed of the system by using multiple processors.
  • It enables single sequential CPUs to do lot of things simultaneously.

Difference between Concurrency and Parellelism:
Parallelism leads to overlapping of tasks in one process with tasks of another process.
Whereas in concurrency the speed is increased by overlapping the input-output activities of one task with CPU process of another task.

Source: View source