DEV Community

Cover image for multi-processing vs multi-threading
Ifeanyi Chima
Ifeanyi Chima

Posted on • Edited on

multi-processing vs multi-threading

I was given the question "what is difference between multi-processing and multi-threading" as an interview question. Today, I will not use big grammatical words to explain the differences between multi-processing and multi-threading to make it very easy for everyone to understand.

BMC

first, we need to understand these terms

  1. Processor (CPU) is a chip that exists on the computer's mother-board, it executes the basic instructions that are given to it. It receives commands and perform the operations the user has requested. For example, the CPU processed the instructions to use a web browser to open and display this web page on your computer. refrence

  2. Process is a program in execution.

Now that we have established the facts, let us get into the details.

Multi-processing

This is when a computer has two or more processors (CPUs). Todays' computers can have 2,4,8 CPUs. Device manufacturers leverage multiple CPUs to increase application performance and responsiveness (no lagging).
In multi-processors, we can run multiple programs (music app, gaming app, MS-word) at the same time.

Multi-threading

Firstly, a thread is a unit of a process.

Multi-threading means many threads run in the same parent process (program) at the same time. For example, using MS-word is a process (program), while using spell-check and copy-paste in MS-word is a thread.

Creating processes for each task is not an effective method. Therefore, a process is divided into multiple threads. These multiple threads are running on the process at the same time.

Differences between muti-processing and multi-threading

Mult-processing Multi-threading
Multi-processing means a computer having two or more CPUs (processors) and it is able to run multiple programs at the same time. Multi-threading means many threads run in the same parent process (program) at the same time.
Multi-processing; a lesser amount of time is taken for processing a task (job). Multi-threading; a moderate amount of time is taken for processing a task (job).
Multi-processing executes many programs at the same time Multi-threading executes many threads at the same time.

Thank You, please follow me

twitter
github
linkedin

Buy Me A Coffee

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

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