[Logo]
Forums Register Login
Question on a Mock Exam Question
Hello, I have question about Mr. Dan Chisholm's mock exam.
(Single Topic - Section 7: Threads - Exam 2 - 10)

Question and answer are:

[Question]
After invoking the wait method on an object, obj1, a thread, T1, will remain in the wait set of obj1 until which of the following occurs?

a. Another thread invokes the notify method on the object, obj1, and T1 is selected to move out of the wait set
b. Another thread invokes the notifyAll method on the object
c. Another thread invokes the resume method on thread T1
d. Another thread interrupts thread T1
e. The priority of thread T1 is increased
f. A specified timeout period has elapsed
g. Another thread invokes the join method on thread T1

[Answer]
And Ans given is a b d f.
But I think answer a is not right. Because when another thread invokes the notify method on the object, obj1, and T1 or other thread is selected to move out of the wait set.


Thank you.

[ December 14, 2004: Message edited by: Hide Issa ]
[ December 14, 2004: Message edited by: Hide Issa ]
Dan has been very specific and stated the thread T1 is selected to move out of the wait set. So option a is true. If he had not said that T1 is selected, then you would be correct (that is using notify() alone is insufficient).
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 19, 2017 17:48:04.