Dealing With Contention medium
In CPU caching, what is 'False Sharing'?
- A Sharing passwords.
- B Using a fake variable.
- C Virtual Memory pages.
- D When two independent variables sit on the same Cache Line. Two threads modifying different variables invalidate each other's cache line, killing performance.
Answer: D. When two independent variables sit on the same Cache Line. Two threads modifying different variables invalidate each other's cache line, killing performance.
Padding forces variables to different cache lines to ensure true independence.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- Why is 'Exponential Backoff' preferred over constant intervals for retries?
- What is the primary purpose of a Mutex (Mutual Exclusion) lock?
- Why does adding more threads sometimes *decrease* performance?
- In a Saga, if a Compensating Transaction (Undo) fails repeatedly due to contention, what is the last resort?
- In a database, what happens if Transaction A locks a row and Transaction B tries to modify the same row?
- A database restart causes thousands of application servers to instantly try to reconnect. This crashes the DB again. This is called: