Hello,
In the following question:
1)Assume the following method is properly synchronized and called from a
thread A on and object B:
After calling this method, when will the thread A become a candidate to get another turn at the CPU ?
A.After object B is notified, or after two seconds
B. After the lock on B is released, or after two seconds.
C.Two seconds after object B is notified.
C.Two seconds after lock B is released.
Answer : My answer went for 'B' because lets say after 2 seconds the thread stops waiting (because it wasn't notified) it cannot acquire the lock immediately unless A releases it right ? In case of
this is the expected behavior .Please correct me if i am wrong.
Thanks,
Adithya.