Solved

Stale Data Occurs in Multi-CPU Machines When One Thread Modifies

Question 34

Multiple Choice

Stale data occurs in multi-CPU machines when one thread modifies shared data and a second thread accesses that data later, but sees the data value before the change took place. What is required to guarantee that the second thread sees the updated data, not stale data when access to the shared data occurs in two different methods?


A) One method needs to acquire then release the lock after modifying the data.
B) Both methods need to acquire then release the lock after modifying or reading the data.
C) Never change any shared object data in multi-CPU machines.
D) Never use locks for any shared data in multi-CPU machines.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions