15.1 Processors, Parallel Processing and \cdot irtual Machines
Learning Objective
Show understanding of the concept of a virtual machine (VM) and its role in modern computing.
What is a \cdot irtual Machine?
A virtual machine is a software abstraction that emulates a physical computer system. It provides an isolated execution environment that behaves like a real processor, memory, storage and I/O devices, allowing programs to run as if they were on dedicated hardware.
Key Characteristics
Isolation – each \cdot M runs independently of others on the same host.
Portability – a \cdot M image can be moved between different physical machines.
Resource sharing – multiple \cdot Ms share the underlying hardware resources.
Encapsulation – the complete state of a \cdot M can be saved, copied or restored.
Types of \cdot irtual Machines
System \cdot irtual Machines – emulate an entire operating system (e.g., VMware Workstation, VirtualBox).
Process \cdot irtual Machines – provide a runtime environment for a single program or language (e.g., Java \cdot irtual Machine, .NET CLR).
How a \cdot irtual Machine Works
The host machine runs a hypervisor (also called a virtual machine monitor). The hypervisor translates the \cdot M’s privileged instructions into safe operations on the physical CPU and manages allocation of memory, storage and I/O.
Benefits of Using \cdot irtual Machines
Benefit
Explanation
Consolidation
Multiple \cdot Ms replace many physical servers, reducing hardware costs.
Testing & Development
Developers can create disposable environments without affecting the host.
Security
Compromised \cdot Ms can be isolated and discarded without harming the host.
Scalability
Resources can be re‑allocated to \cdot Ms on demand, supporting dynamic workloads.
Virtual Machines and Parallel Processing
When a host has multiple CPU cores, the hypervisor can schedule different \cdot Ms on different cores, achieving true parallel execution. Additionally, a single \cdot M can be configured to use multiple virtual CPUs (vCPUs), which the hypervisor maps onto physical cores.
Example: Java \cdot irtual Machine (J \cdot M)
The J \cdot M is a process virtual machine that executes Java bytecode. It provides:
Automatic memory management (garbage collection).
Just‑In‑Time (JIT) compilation – converting bytecode to native machine code at runtime.
Platform independence – the same .class files run on any device with a compatible J \cdot M.
Mathematically, the performance gain of parallel execution can be approximated by Amdahl’s Law:
\$S = \frac{1}{(1 - P) + \frac{P}{N}}\$
where \$S\$ is the speedup, \$P\$ is the proportion of the program that can be parallelised, and \$N\$ is the number of parallel units (e.g., vCPUs).
Key Terms
Hypervisor – software layer that creates and manages \cdot Ms.
Host – the physical machine on which \cdot Ms run.
Guest – the operating system or application running inside a \cdot M.
vCPU – a virtual CPU allocated to a \cdot M.
Snapshot – a saved state of a \cdot M that can be restored later.
Suggested Diagram
Suggested diagram: Layered view showing hardware at the bottom, the hypervisor above it, multiple system \cdot Ms and process \cdot Ms on top, each with its own guest OS and applications.
Summary Checklist
Define a virtual machine and distinguish between system and process \cdot Ms.
Explain the role of the hypervisor.
List at least three benefits of using \cdot Ms.
Describe how \cdot Ms enable parallel processing on multi‑core hosts.
Apply Amdahl’s Law to estimate speedup when adding vCPUs.