ASSIGNMENT 2 2026
UNIQUE NO.
DUE DATE: 1 JULY 2026
,OPERATING SYSTEMS
Question 01 [15 marks]
a. Scheduling approaches
Per-core run queues:
Each CPU core maintains its own queue of ready processes.
CPU-intensive tasks tend to stay on the same core, improving cache locality.
Interactive tasks may suffer if stuck behind longer tasks in the same queue.
Shared run queue:
All processes are placed in a single global queue.
Any idle core can pick the next available task.
Improves responsiveness for short interactive tasks due to flexible scheduling.
b. Advantages and disadvantages
Per-core run queues
Advantages:
Better CPU cache locality (tasks stay on same core)
Reduced queue contention
Disadvantages:
Load imbalance between cores
Requires complex load balancing
Shared run queue
, Advantages:
Good load balancing across cores
Better responsiveness for interactive tasks
Disadvantages:
High contention on shared queue
Poor cache locality due to task migration
c. Load imbalance scenario
The shared run queue is better for balancing workload because:
All cores draw from a single pool of tasks.
Idle cores can immediately fetch tasks.
Prevents some cores from being overloaded while others are idle.
d. Recommendation
Recommended: Per-core run queues with load balancing
High performance due to reduced contention
Better cache efficiency (CPU-bound tasks remain on same core)
Fairness ensured through periodic task migration
Suitable for mixed workloads (interactive + CPU-intensive)
Question 02 [15 marks]