A process waits for disk data before continuing. Which state is it in?
What is a process?
- A program while it runs, plus its registers, memory map, and open files
- Any file stored on disk
- The processor chip itself
A context switch only copies a few registers and costs nothing else.
Circle one: True False
Right after a switch, the new process runs slowly at first. Why?
- The cache still holds the old process data
- Its files were closed by the kernel
- Its registers were saved wrongly
Order the steps of a context switch.
- Jump first, then save both states
- Load next state before saving the old one
- Save old state, load next state, jump back in
A kernel performs 3 switches. Each switch copies 16 registers directly. How many register copies happen in total?
Answer: ______________
A student claims the switch cost ends once registers are saved. What is the error?
- Switches never touch registers
- Saving registers is unnecessary
- The claim ignores the cold cache slowdown after the switch
A machine switches ten times more often yet finishes less work. What is the likely cause?
- Registers got larger
- Each switch repays the cold cache bill, crowding out real work
- Blocked processes vanished
What a context switch really moves W1-mt_oiOwHKUoXG-s1
- Blocked · Blocked means waiting for an event such as arriving data.
- A program while it runs, plus its registers, memory map, and open files · A process pairs running code with everything the kernel tracks for it.
- False · Copying is quick, but the new process also inherits a cold cache.
- The cache still holds the old process data · Caches fill with whatever ran recently, so the newcomer fetches from slow memory.
- Save old state, load next state, jump back in · The kernel stores the paused process before installing the next one.
- 48 · Three switches times 16 registers each gives 48 copies.
- The claim ignores the cold cache slowdown after the switch · The dear part follows the copy: slow early fetches from a cache of old data.
- Each switch repays the cold cache bill, crowding out real work · Frequent switches spend the processor on refetching instead of running programs.