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?
A) The second thread should not try to acquire the lock.
B) The first thread should not try to acquire the lock.
C) Neither thread should use locks.
D) The first thread should release the lock after changing the data.
Correct Answer:
Verified
Q26: What happens if we try to start
Q62: A GUI should be responsive to the
Q65: When is it a good idea to
Q68: Exactly when does a thread finish in
Q69: Under what conditions are locks unnecessary for
Q73: Class MyClass has two ReentrantLock objects, myLock1
Q74: Under what circumstances will a call to
Q76: Assume two threads share a BankAccount object
Q77: What is the relationship between synchronized code
Q77: Assume three threads share a BankAccount object
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents