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:

Verified
Correct Answer:
Verified
Q29: Exactly when does a thread finish in
Q31: Given a single CPU and four threads,
Q32: Examine the SharedData class shown below. Suppose
Q33: Suppose thread one is downloading a 800KB
Q36: "Livelock" occurs when one thread runs continuously,
Q37: Examine the SharedData class shown below. Suppose
Q44: When a thread is interrupted, the most
Q62: Each thread runs for a short amount
Q70: The _ method does not actually cause
Q79: What is likely to be true when