Memory Hierarchy
Running two programs alternately on the same core can make each slower than running alone. What is the best explanation from a cache perspective?
- AAlternating doubles the number of instructions that each of the two programs executes
- BAlternating reconfigures the cache to half its capacity
- CThe other program evicts one's data, causing reloads
Show answer and explanation
Answer: C. The other program evicts one's data, causing reloads
When programs switch, the caches and TLB fill with the other program's data, so by the time a program runs again its data has been evicted. Accesses that would hit when running alone now miss, costing time to reload from main memory. The shorter the interval between switches, the larger the effect. Instruction counts are unchanged and cache capacity is not reconfigured; the slowdown comes from sharing the cache.
- A. Each program's instruction count is unchanged.
- B. Cache capacity does not change.
- C. Correct. The other program's data evicts one's own, increasing reload misses.