DEV Community

Sandeep Borhade
Sandeep Borhade

Posted on

Concurrency vs Parallelism

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.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay