CC3011 – Operating Systems
Assignment 1 – Fall 2025
Name: Salman shah
Class: BS CS Sec-A
Student-Id: 23018020031
Instructor: Mr. Tayyab
Q1. Describe the differences between symmetric and asymmetric multiprocessing. What
are three advantages and one disadvantage of multiprocessor systems?
Difference between Symmetric and Asymmetric Multiprocessing
In computer architecture, the distinction between Symmetric Multiprocessing (SMP) and
Asymmetric Multiprocessing (AMP) lies primarily in how the hardware and operating system
manage the workload and resource control.
Architectural Hierarchy (Master-Slave vs. Peers):
In an Asymmetric Multiprocessing (AMP) environment, a "master-slave" relationship
exists. One primary processor (the master) is responsible for the operating system’s
kernel and scheduling functions, while the remaining processors (slaves) strictly execute
user tasks assigned to them.
Conversely, Symmetric Multiprocessing (SMP) treats all processors as equals (peers).
Each processor runs its own copy of the operating system scheduler and can handle any
task—whether it is an OS kernel process or a user application—as long as the shared
memory is synchronized.
Memory and I/O Access:
In AMP systems, I/O handling is often restricted to the master processor to simplify data
integrity. In SMP systems, all processors share the same physical memory and I/O bus,
allowing any CPU to initiate Input/Output operations. This requires complex hardware
and software mechanisms to prevent data corruption (cache coherency) since multiple
CPUs might try to access the same memory address simultaneously.
Advantages:
1. Augmented Computational Throughput: By utilizing multiple processing cores, the
system can execute tasks in parallel. While doubling the processors does not strictly
double the speed due to coordination overhead, it significantly increases the volume of
work the system can complete within a specific timeframe (throughput), particularly for
multithreaded applications.
2. Resource Cost Efficiency (Economy of Scale): Multiprocessor systems share essential
peripherals, including mass storage, power supplies, and chassis. It is economically more
viable to have a single machine with four processors sharing one high-speed disk drive
and power unit than to maintain four separate single-processor computers.
3. Fault Tolerance and Graceful Degradation: These systems offer superior reliability. If
a specific processor suffers a hardware failure, the entire system does not halt. Instead,
the operating system can redistribute the workload to the remaining functional
processors. The system may slow down (degrade), but it continues to operate (graceful
degradation) rather than crashing completely.
Disadvantage
Complexity in Synchronization and Design:
The primary drawback is the significant complexity involved in both hardware and software
design. The operating system must implement rigorous locking mechanisms and scheduling
algorithms to ensure that two processors do not modify the same shared data simultaneously.
Furthermore, maintaining cache coherency—ensuring that a change in one processor’s local
cache is immediately reflected in the others—requires expensive hardware logic and consumes
system bandwidth.
Q2. How do clustered systems differ from multiprocessor systems? What is required for
two machines belonging to a cluster to cooperate to provide a highly available service?
Differences: Clustered Systems vs. Multiprocessor Systems
While both architectures aim to increase computing power through parallelism, they differ
fundamentally in their coupling and memory structure:
1. Coupling and Memory: Multiprocessor systems are tightly coupled; they share a global
system clock and a single physical memory space. Communication occurs at the speed of
the system bus. In contrast, clustered systems are loosely coupled. They consist of
distinct, standalone computers (nodes), each with its own private memory and operating
system instance, connected via a local area network (LAN) or a high-speed interconnect
(like InfiniBand).
2. System Image: To the operating system kernel, a multiprocessor looks like one machine
with many heads. A cluster looks like a group of separate machines that utilize
middleware (software layers) to act as a single logical unit.
Requirements for High Availability in Clusters
For a cluster to provide High Availability (HA)—ensuring services survive a node failure—two
specific cooperative mechanisms are required:
1. Shared Storage Architecture: The nodes must have access to the same data, usually via
a Storage Area Network (SAN). If the primary node fails, the data must not be locked
inside that failed machine; the secondary (backup) node must be able to instantly access
the database or files on the shared storage to take over the operation.
2. State Monitoring (Heartbeat Mechanism): The nodes must constantly monitor each
other’s health. This is typically achieved through a "heartbeat" signal—a periodic
message sent between nodes. If the backup node stops receiving the heartbeat from the
primary node, it assumes a failure has occurred and triggers a failover, launching the
service on itself to minimize downtime.
Q3. In a multiprogramming and time-sharing environment, several users share the system
simultaneously. This situation can result in various security problems.
a. What are two such problems?
1. Unauthorized Memory Access / Data Leakage:
Since multiple programs reside in the RAM simultaneously, there is a risk that a
malicious or poorly written process might attempt to read data outside its allocated
address space. Without strict memory protection boundaries (like base and limit
registers), one user could theoretically read the passwords or private input buffers of
another active user.
2. Denial of Service (Resource Hogging):
A malicious user or a buggy program could monopolize system resources (CPU cycles,
memory, or I/O channels), effectively "starving" other users. For example, a process
could enter an infinite loop or fork-bomb (creating endless copies of itself), rendering the
system unresponsive for all other legitimate users sharing the environment.
b. Can we ensure the same degree of security in a time-shared machine as in a dedicated
machine? Explain your answer
Answer: No, it is generally not possible to achieve the exact same degree of security in a timeshared system as in a dedicated machine.
Explanation:
Security relies heavily on isolation. A dedicated machine offers physical isolation; if a computer
is disconnected from a network and used by only one person, the attack surface is negligible.
In a time-shared environment, we rely on logical (software) isolation provided by the Operating
System. While modern OS kernels are robust:
1. Software Vulnerabilities: Operating systems are composed of millions of lines of code.
It is statistically probable that bugs or "backdoors" exist that allow privilege escalation,
where a standard user tricks the OS into giving them administrative rights.
2. Side-Channel Attacks: Even with perfect software permissions, hardware vulnerabilities
(like Spectre or Meltdown) allow processes to infer data from other processes sharing the
same physical CPU cache.
3. Configuration Error: The complexity of managing permissions for hundreds of users
increases the likelihood of human error by the system administrator, leaving files or
directories inadvertently exposed.