Multiprocessing, Explained | Introduction to Operating Systems

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

← 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 →

Earn 3 college credits for Introduction to Operating SystemsRecommended for credit by NCCRS · Computer Science 354 · self-paced · one payment, lifetime access

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.

Compare: Linux vs Operating Systems

Why take it here

Why students take Introduction to Operating Systems with UPI Study

What happens under every app you runIntroduction to Operating Systems explains the software that runs a computer: processes and scheduling, threads and synchronization, deadlock, memory and paging, devices and storage, file systems, networking, security and virtualization. It suits computer science and information technology degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

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.

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?
Concurrency means several jobs are in progress during the same period, even if only one runs at any instant, like one baker switching between three trays. Parallelism means jobs truly run at the same instant, which takes more than one CPU or core, like two bakers working side by side. Multiprocessing is about parallelism, while a single CPU can only be concurrent.
What is the difference between symmetric and asymmetric multiprocessing?
In asymmetric multiprocessing, one boss CPU runs the operating system and hands out work to the others, which is simple but makes the boss a bottleneck and a single point of failure. In symmetric multiprocessing, every CPU is equal, can run the operating system, and picks its own jobs from a shared list. Nearly every laptop, phone, and server uses the symmetric design.
Does doubling the number of cores make a program twice as fast?
No, extra cores help only with work that splits into independent pieces. A job with eight one-minute tasks plus a final three-minute step that combines their results takes 11 minutes on one core and still 5 minutes on four cores, because the in-order step never speeds up. This limit on speedup from parallel hardware is often described by Amdahl's law.
What is a multicore processor?
A multicore processor is a single chip holding several independent cores, each a full CPU running its own instructions, so a quad-core chip has four. The operating system sees each core as a CPU and runs symmetric multiprocessing on top. Many chips mix fast performance cores with power-saving efficiency cores, and the operating system decides which kind each task lands on.

About the Introduction to Operating Systems course

How many college credits is Introduction to Operating Systems?
Introduction to Operating Systems (Computer Science 354) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Introduction to Operating Systems cost and what is included?
$250, paid once, with lifetime access: all 83 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Introduction to Operating Systems take?
It is self-paced with no deadlines. The 83 lessons total about 10 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

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

Introduction to Operating Systems
3 credits · NCCRS
Enroll →