UPI Study › Courses › Introduction to Operating Systems › Free lessons › Lesson 2.1 Free with a free account
Multiprocessing
Introduction to Operating Systems · Chapter 2: Process Management: Scheduling, Multitasking, and System CallsSection 2.1 · lesson 10 of 837 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Introduction to Operating Systems.
Lesson complete
Earn the 3 college credits for Introduction to Operating Systems
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Processes →← The Boot ProcessNext lesson: Processes →
A free account plays all of Chapter 1 and 3 more lessons of Introduction to Operating Systems. Create a free account →
In this lesson
How several CPUs and cores share work under one operating system.
- Distinguish concurrent execution from parallel execution
- Compare asymmetric and symmetric multiprocessing and their weaknesses
- Describe multicore processors, including performance and efficiency cores
- Calculate how much extra cores speed up a job with an in-order step
Free study notes
Get this lesson's notes by email
The key points and 4 practice questions with answers, in your inbox. One email, free.
One email. Unsubscribe in one click.
Transcript
Everything said in the video, section by section (915 words). Read along, or search it.
Opening Question
Would a Second Brain Help
Sam, who runs a small online bakery, has an old laptop. And every Friday, it groans. The shop page is loading, the label printer is queued, and the photo editor is still exporting cake pictures. Sam wonders whether a second brain inside the laptop would help. Here's the surprise. Most laptops already have several, and the operating system decides which one does what.
Definition
One CPU Does One Thing at a Time
Start with the CPU, the central processing unit. It's the part that actually carries out instructions, one tiny step at a time. A computer with one CPU does exactly one thing at any instant. It only feels like many things happen at once because it switches very fast. Lesson 2.4 shows that trick. A multiprocessing system has two or more CPUs, working together under one operating system.
Analogy
Two Ovens Bake in Parallel
Think of Sam's kitchen. With one oven, three trays of muffins bake one after another. With two ovens, two trays bake at the same moment, and the third goes in as soon as an oven is free. If each tray takes twenty minutes, one oven needs an hour. Two ovens need forty minutes. Doing several jobs at the very same instant is called parallel execution. It needs more than one CPU, just as it needs more than one oven.
Key Distinction
Concurrent Versus Parallel
One word needs care. Concurrent means several jobs are in progress during the same period, even if only one runs at any instant. That's one baker, switching between three trays. Parallel means the jobs truly run at the same instant, which takes two bakers, or two CPUs. Multiprocessing is about this second kind.
Three Reasons
Throughput, Reliability, and Cost
Why would a designer want several CPUs? Three reasons come up again and again. Throughput: more jobs finished per hour. Reliability: if one CPU fails, a well-built system can keep going on the others, just a little slower. And cost: several CPUs sharing one memory, one disk and one power supply cost less than several whole computers.
Asymmetric Design
One Boss CPU Hands Out Work
Once there are several CPUs, someone has to decide who does what. There are two classic answers. In asymmetric multiprocessing, one CPU is the boss. Only the boss runs the operating system and hands out work. The others are workers that follow orders. It's simple, because only one CPU ever touches the operating system's tables. But the boss can become a bottleneck. And if the boss fails, everything stops.
Symmetric Design
Every CPU Is Equal
In symmetric multiprocessing, every CPU is equal. Each one can run the operating system and user programs. Each picks its own next job from one shared list. Nearly every laptop, phone and server you meet works this way. It's harder to build, because two CPUs must never grab the same job, or change the same table, at the same moment. Lessons 3.1 to 3.4 are about exactly that. The payoff is no single point of failure, and no boss to overload.
Multicore Chips
Several Cores on One Chip
Early multiprocessing meant several separate chips on one board, which was expensive. Today the usual way is a multicore processor: one chip holding several independent cores. Each core is a full CPU, running its own instructions. A quad-core chip has four cores. To the operating system each core looks like a CPU, so it runs symmetric multiprocessing on top. Many chips mix fast cores with thrifty, power-saving ones. The Mac this video was made on reports two kinds: performance cores and efficiency cores. The operating system decides which kind a task lands on, so a quick chat message can use a thrifty core and save battery.
Limits of Speedup
Only Independent Work Splits
So does doubling the cores halve the time? Only if the work splits into pieces that don't wait on each other. Sam can print twenty labels on four printers at once. But nobody can bake a cake and ice it at the same time: the icing needs the finished cake. Work that must happen in order stays one-core work, however many cores exist. Twelve independent tasks of one minute each take twelve minutes on one core, and three minutes on four cores. That only works because they really are independent.
Quick Check
Eight Tasks Plus a Final Step
Quick check. A report job has eight independent tasks of one minute each. Then a final three-minute step combines all eight results, so it can't start until they're all done. On one core, the job takes eleven minutes. On a four-core chip, how long does it take? Pause, and decide. Five minutes. The eight tasks split across four cores in two rounds, so they take two minutes. The final step needs every result, so it runs on one core while the other three sit idle. That's three more minutes. Under three minutes would be right only if the whole job could split. The in-order part never speeds up.
Real Example
One Busy Core, Others Idle
Back to Sam's laptop. Ivy, who looks after the computers at a school, watched it during a Friday slowdown. The shop page uses only one core, she said, and that core is the bottleneck. The other cores are bored. So a laptop with more cores wouldn't fix it. Not until the shop program is written to split its work. Meanwhile, the operating system can still run the printer queue, and the photo export, on the idle cores.
Key Takeaways
More CPUs Help Splittable Work
To recap. A multiprocessing system has two or more CPUs under one operating system, so jobs can truly run in parallel. Asymmetric multiprocessing has one boss CPU. In symmetric multiprocessing, every CPU is equal and picks from a shared list. A multicore chip puts several cores, each a full CPU, on one chip. And extra cores help only with work that splits into independent pieces.
About Introduction to Operating Systems at UPI Study
Introduction to Operating Systems (Computer Science 354) is a self-paced online course of 83 video lessons in 10 chapters, from what an operating system does and process scheduling to concurrency, memory, devices, file systems, networks, the internet, security and virtual machines. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Computer Science courses Every course with PRO →
Compare: Linux vs Operating Systems
Why take it here
Why students take Introduction to Operating Systems with UPI Study
Where the credit goes
Universities that work with NCCRS
Introduction to Operating Systems carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Multiprocessing
What is the difference between concurrency and parallelism?
What is the difference between symmetric and asymmetric multiprocessing?
Does doubling the number of cores make a program twice as fast?
What is a multicore processor?
About the Introduction to Operating Systems course
How many college credits is Introduction to Operating Systems?
How much does Introduction to Operating Systems cost and what is included?
Which universities accept UPI Study credits?
How long does Introduction to Operating Systems take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Introduction to Operating Systems.
83 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
Updated
3 credits · NCCRSEnroll →