Practice
Solution
Step 1: Identify what is saved during thread context switch
Only the CPU registers and stack pointer specific to the thread are saved and restored, since threads share the process memory space.Step 2: Understand process state remains unchanged
The process's memory and resources remain intact; no need to save or reload the entire process state.Step 3: Evaluate options
The OS saves the entire process state and reloads it for the new thread incorrectly saves the entire process state. The OS flushes the process's memory cache and reloads it for the new thread incorrectly flushes memory cache. The OS terminates the current thread and creates a new thread for the next task incorrectly terminates and recreates threads.Final Answer:
Option D -> Option DQuick Check:
Thread context switch saves/restores thread-specific CPU state only [OK]
- Confusing process context switch with thread context switch
- Assuming memory cache must be flushed on thread switch
- Believing threads are terminated and recreated on each switch
Solution
Step 1: Recall linked allocation properties
Linked allocation stores file blocks non-contiguously with pointers linking blocks sequentially.Step 2: Analyze linked allocation eliminates external fragmentation by allowing non-contiguous storage
Correct: linked allocation avoids external fragmentation by allowing scattered blocks.Step 3: Analyze linked allocation supports efficient direct access to any block in the file
Incorrect: linked allocation does not support efficient direct access; it requires sequential traversal.Step 4: Analyze each file block contains a pointer to the next block in the chain
Correct: each block contains a pointer to the next.Step 5: Analyze linked allocation requires only the starting block address to access the entire file
Correct: only the starting block address is needed to traverse the file.Final Answer:
Option B -> Option BQuick Check:
Linked allocation -> no efficient direct access, only sequential traversal.
- Assuming linked allocation supports direct access
- Confusing external fragmentation with internal fragmentation
Solution
Step 1: Analyze Segments can vary in size and represent logical units of a program
Segments are variable-sized logical units; this is correct.Step 2: Analyze Segmentation completely eliminates fragmentation issues
Segmentation does not eliminate fragmentation; it can cause external fragmentation.Step 3: Analyze Segment tables store base and limit for each segment
Segment tables store base and limit addresses; this is correct.Step 4: Analyze Segmentation allows sharing of segments between processes
Segmentation supports sharing segments like code segments; this is correct.Final Answer:
Option A -> Option AQuick Check:
Fragmentation remains a problem in segmentation due to variable sizes.
- Believing segmentation removes all fragmentation
- Confusing segment tables with page tables
- Assuming segments cannot be shared
Solution
Step 1: Review binary semaphore properties
Binary semaphores do not enforce ownership; any thread can signal.Step 2: Review mutex properties
Mutex enforces ownership; only locking thread can unlock.Step 3: Analyze each statement
A is correct; B is correct; C is incorrect because binary semaphores lack ownership enforcement; D is correct.Final Answer:
Option C -> Option CQuick Check:
Binary semaphore ownership enforcement is the key difference from mutex.
- Assuming binary semaphore enforces ownership like mutex
- Confusing signaling with mutual exclusion
- Believing mutexes are used for signaling
Solution
Step 1: Understand working set model overhead
The model requires monitoring page references over time windows, which can be costly.Step 2: Analyze options
A is correct because tracking page references precisely is resource-intensive.
B is incorrect because even with working set allocation, some page faults can occur.
C is incorrect because working set sizes vary widely among processes.
D is incorrect because load control is still needed when total working sets exceed memory.Final Answer:
Option A -> Option AQuick Check:
Working set tracking overhead is a practical limitation often underestimated.
- Assuming working set eliminates all page faults
- Believing all processes have similar working sets
- Ignoring the need for load control
