🧠 What is Multiprocessing?

Multiprocessing refers to a computer system with two or more CPUs (or cores) that can execute instructions simultaneously.

In simple terms:
Instead of one CPU switching between programs, you have multiple CPUs running programs in parallel.


🧱 Multiprocessing = True Parallelism

FeatureDescription
🧩 Hardware-levelRequires multiple processors or CPU cores
🚀 Runs multiple processes at onceNot just switching (like multiprogramming), but actual parallel execution
🎯 Improves speed, reliability, and throughputMore power, less waiting

⚙️ Types of Multiprocessing Systems

TypeDescriptionExample
Symmetric Multiprocessing (SMP)All CPUs are equal; OS assigns tasks dynamicallyMost modern desktops, servers
Asymmetric Multiprocessing (AMP)One master CPU controls others (often in embedded systems)Real-time or older systems

🔁 Multiprocessing vs Multiprogramming

FeatureMultiprogrammingMultiprocessing
🧠 ConceptOne CPU switches between tasksMultiple CPUs work at the same time
⚙️ ExecutionConcurrent (via switching)Parallel (truly simultaneous)
🛠️ HardwareSingle CPU neededMultiple CPUs/cores required
🚀 GoalMaximize CPU utilizationMaximize performance and speed
🎯 ExampleRunning Excel and Word on one coreRunning one on core 1 and one on core 2 at the same time

📦 Why Multiprocessing?

BenefitWhy It Matters
🧠 True parallelismMultiple programs run at once
🚀 Faster executionSplit workloads (e.g., multithreaded apps)
🔁 Improved responsivenessOne stuck task doesn’t affect others
🛡️ Fault toleranceSome systems can survive if one processor fails

🧪 Real-World Examples

SystemMultiprocessing
Linux / WindowsUses all available CPU cores for processes
Java JVMThreads can run in parallel on multiple cores
DatabasesParallel query execution
Video gamesPhysics, AI, rendering on separate cores

⚙️ How OS Handles Multiprocessing

  • The OS must have a scheduler that assigns tasks to available CPUs.

  • It must manage:


🧠 Interview-Ready Definition:

Multiprocessing is the use of two or more processors (or cores) within a single computer system to execute multiple processes simultaneously. It enables true parallel processing, resulting in faster execution, higher system throughput, and better responsiveness.