Practice
Solution
Step 1: Understand the initial action
Each philosopher picks up their left fork simultaneously, so all forks on the left side are held.Step 2: Analyze waiting condition
Each philosopher now waits for the right fork, which is held by their neighbor, creating a circular wait.Step 3: Identify the system state
This circular wait with no forks released leads to deadlock.Final Answer:
Option C -> Option CQuick Check:
Deadlock arises immediately due to circular wait and mutual exclusion.
- Assuming philosophers can eat simultaneously
- Confusing deadlock with starvation
- Believing system recovers automatically without intervention
Solution
Step 1: Review privilege separation
User mode is restricted; kernel mode has full privileges.Step 2: Validate each statement
User mode code cannot directly access kernel memory for protection reasons. is true; user mode cannot access kernel memory. Kernel mode has unrestricted access to all hardware and memory. is true; kernel mode has full access. Mode switches are triggered by traps or interrupts to ensure controlled privilege escalation. is true; traps/interrupts cause mode switches.Step 3: Identify incorrect statement
System calls execute entirely in user mode without switching to kernel mode. is false; system calls require switching to kernel mode to execute privileged operations.Final Answer:
Option D -> Option DQuick Check:
System calls always involve mode switch to kernel [OK]
- Believing system calls run entirely in user mode
- Confusing hardware interrupts with system calls
- Assuming user mode can access kernel memory
Solution
Step 1: Recall Banker's Algorithm assumptions
The algorithm assumes the system starts in a safe state to guarantee deadlock avoidance.Step 2: Analyze the scenario
If the system is already unsafe, granting requests--even if individually safe--cannot guarantee overall safety.Step 3: Evaluate options
A ignores the unsafe starting state.
B and C describe actions outside the algorithm's scope.Final Answer:
Option A -> Option AQuick Check:
Banker's Algorithm cannot recover from unsafe states; it only avoids entering them.
- Assuming safe requests can fix unsafe states
- Believing the algorithm preempts resources
- Thinking system restarts are part of the algorithm
Solution
Step 1: Understand process types in FCFS
FCFS schedules strictly by arrival order, regardless of process type.Step 2: Analyze impact of mixed workloads
CPU-bound processes arriving first can delay I/O-bound processes, worsening the convoy effect and increasing waiting times.Step 3: Mitigation strategy
Introducing preemption or priority scheduling can reduce waiting times for I/O-bound processes by allowing them to run sooner.Step 4: Evaluate options
A is incorrect; convoy effect does not disappear automatically.
B is correct; convoy effect worsens and preemption helps.
C is incorrect; waiting times do change due to process mix.
D is incorrect; convoy effect is relevant because all processes compete for CPU.Final Answer:
Option B -> Option BQuick Check:
Mixed workloads worsen convoy effect; preemption mitigates it.
- Assuming I/O-bound processes run first automatically
- Believing waiting times don't change with process mix
- Ignoring convoy effect in mixed workloads
Solution
Step 1: Identify internal fragmentation cause
Buddy system rounds allocations to power-of-two sizes, causing internal fragmentation.Step 2: Evaluate strategies
Slab allocator efficiently manages fixed-size objects, reducing internal fragmentation without slowing allocation.Step 3: Analyze other options
Increasing minimum block size (A) increases internal fragmentation; compaction (C) addresses external fragmentation; fixed partitioning (D) is inflexible and can worsen fragmentation.Final Answer:
Option C -> Option CQuick Check:
Slab allocators complement buddy system to reduce internal fragmentation [OK]
- Thinking compaction reduces internal fragmentation
- Assuming bigger minimum block size reduces fragmentation
- Believing fixed partitioning eliminates fragmentation
