Parallel processing and virtual machines
| English | Chinese | Pinyin |
|---|---|---|
| virtual machines | 虚拟机 | xū nǐ jī |
| parallelism | 并行 | bìng xíng |
| SIMD | 单指令多数据 | dān zhǐ lìng duō shù jù |
| MIMD | 多指令多数据 | duō zhǐ lìng duō shù jù |
| massively parallel | 大规模并行 | dà guī mó bìng xíng |
| distributed memory | 分布式内存 | fēn bù shì nèi cún |
| hypervisor | 虚拟机监控器 | xū nǐ jī jiān kòng qì |
| sandboxing | 沙箱 | shā xiāng |
| bytecode | 字节码 | zì jié mǎ |
| just-in-time compilation | 即时编译 | jí shí biān yì |
One computer pretending to be forty
- A company used to buy one physical server per application: one for mail, one for the website, one for accounts. Each ran at about 8% of its capacity, and each drew full power in a rack that had to be cooled.
- Then the servers stopped being machines and became files. Forty virtual machines 虚拟机 now run on three physical hosts, each one convinced it has a processor, memory and disks of its own.
- The saving is not only electricity. A virtual machine can be snapshotted before a risky change, copied to another host while running, and destroyed if it is compromised.
- This lesson is parallelism 并行 and the virtual machine: how the two system architectures differ, and what a VM costs and buys.
Parallel architectures, briefly
- Parallelism means many processing elements working at once. Flynn's taxonomy names the shapes: SIMD 单指令多数据 runs one instruction over many data items, and MIMD 多指令多数据 runs different instructions on different data.
- A massively parallel 大规模并行 machine takes MIMD to thousands of processors, each with its own distributed memory 分布式内存, communicating by messages.
- Speed no longer comes from raising the clock, which is limited by heat, but from doing more things at once. Every architecture on this page is an answer to that.

Different instructions, different data, at the same time
SIMD means:
Single Instruction, Multiple Data — e.g. a GPU running the same operation on thousands of pixels.
Match each of Flynn's categories to an example.
Flynn classifies by how many instruction and data streams run at once: SISD, SIMD, MIMD (and the rare MISD).
A massively parallel computer uses:
Massively parallel systems (supercomputers) link thousands of processors with distributed memory over a fast network.
What a virtual machine is
- A virtual machine is a software emulation of a whole computer. The software running inside it sees a processor, memory and disks that look real but are provided and managed by host software.
- There are two kinds, and the exam distinguishes them: a system VM runs a complete guest operating system, and a process VM runs one program's portable code.
- Neither is an emulator of a faster machine. A VM's purpose is isolation and portability, not speed.
Computing concept lab
Classify concrete examples by the computing idea they demonstrate.
What is a virtual machine?
The point is emulation and isolation, not speed. A system VM runs a whole guest OS; a process VM runs one program's bytecode.
System virtual machines
- A hypervisor 虚拟机监控器 is the software that creates and manages virtual machines, dividing the host's real processor, memory and disks between them and keeping each one isolated from the others.
- Each VM boots its own guest operating system, so one host can run Windows, Linux and an old legacy system side by side.
- Uses: running different operating systems on one machine; server consolidation, replacing many under-used physical servers with one host; sandboxing 沙箱, so risky or untrusted software runs isolated and cannot reach the host; and snapshots, so a machine can be rolled back to a known state.

A rack of hosts, each carrying many virtual machines
A hypervisor is used to:
A hypervisor manages system VMs, letting several guest operating systems share one physical machine.
A system VM (managed by a hypervisor) runs a whole guest operating system, whereas a process VM like the JVM just runs one program's portable bytecode.
System VMs share one physical machine among several guest OSes; process VMs give "write once, run anywhere" for a single program.
The software that creates and manages several system VMs on one host is called a ____.
It divides the host's real hardware between the guests and keeps each isolated, which is what makes sandboxing and consolidation possible.
Process virtual machines
- A process VM, also called a language VM, runs one program written in portable bytecode 字节码 rather than the host's machine code. The Java Virtual Machine and the .NET CLR are the examples.
- Benefits: portability, since the same bytecode runs anywhere a VM exists, which is "write once, run anywhere"; runtime safety, since the VM checks what the code does; and just-in-time compilation 即时编译 of hot code to native instructions, so long-running programs approach native speed.
- Costs: an extra layer between the program and the hardware, and the VM must be installed before the program will run at all.
Which are benefits of a process (language) VM such as the JVM? Select all that apply.
The VM must be present; that is the cost of the portability. Portability, safety and JIT are the benefits.
Worked example: which kind of VM
- A security team wants to open suspicious email attachments without risking the company network. A system VM: the guest OS is isolated by the hypervisor, so malware cannot reach the host, and the snapshot is restored afterwards to discard anything it did.
- A developer wants one compiled program to run on Windows, macOS and Linux without recompiling. A process VM: the program is compiled to bytecode and each platform's VM runs it.
- Name the kind, then the property, isolation or portability, that the situation needs.
Put the consequences of one physical host failing, in order.
Consolidation concentrates the risk: one host is a single point of failure for everything it carries. That is the limitation to state.
Worked example: benefits and limitations
- Explain two benefits and two limitations of using virtual machines to replace a company's physical servers. [4]
- Benefits: several servers run on one physical host, so hardware, power and cooling costs fall; and each VM is isolated, so a compromised or crashed server does not affect the others, and can be restored from a snapshot.
- Limitations: the VMs share the host's real processor, memory and disks, so performance is lower than dedicated hardware and one busy VM can starve the others; and if the host fails, every VM on it fails at once.
- Two of each, and each one a consequence, not just a label.
Marks that slip away
- A hypervisor manages system VMs; it is not the guest operating system and not the host's own OS.
- A process VM runs bytecode, which is not machine code. That is what makes it portable.
- The limitation of a VM is shared resources and a single point of failure, not "it is complicated".
- "Sandboxing" needs its consequence: the risky software is isolated from the host, so it cannot damage or reach it.
You've got it
- parallelism answers the clock-speed limit: SIMD for one instruction over many data, MIMD for many instructions, massively parallel for thousands of processors with distributed memory
- a virtual machine is a software emulation of a whole computer
- a system VM runs a full guest OS under a hypervisor: different operating systems on one machine, server consolidation, sandboxing, snapshots
- a process VM runs portable bytecode with runtime safety and just-in-time compilation; the costs are an extra layer, shared host resources and one host failing takes every VM with it