If only one thread is blocked in the wait method of an object, and another thread executes the modify on that same object, then the first thread immediately resumes execution.
If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, it is still possible that the first thread might never resume execution.
If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, then the first thread definitely resumes execution as a direct and sole consequence of the notify call.
If two threads are blocked in the wait method of one object, and another thread executes the notify method on the same object, then the first thread that executed the wait call first definitely resumes execution as a direct and sole consequence of the notify call.
第1题:
Which two CANNOT directly cause a thread to stop executing?()
第2题:
Which statements concerning the methods notify() and notifyAll() are true?
第3题:
A.The Thread.sleep() method can take t1 as an argument.
B.The Object.notify() method can take t1 as an argument.
C.The Thread.yield() method can take t1 as an argument.
D.The Thread.setPriority() method can take t1 as an argument.
E.The Object.notify() method arbitrarily chooses which thread to notify.
第4题:
Given that t1 is a reference to a live thread, which is true?()
第5题:
What happens when thread X executes a wait() method on object A, without owning object A’s lock?()
第6题:
Which two of statements are true?()
第7题:
Under which circumstances will a thread stop?()
第8题:
void waitForSignal() { Object obj = new Object(); synchronized (Thread.currentThread()) { obj.wait(); obj.notify(); } } Which is true?()
第9题:
Given: foo and bar are public references available to many other threads, foo refers to a Thread and bar is an Object. The thread foo is currently executing bar.wait(). From another thread, what provides the most reliable way to ensure that foo will stop executing wait()?()
第10题:
Which two can directly cause a thread to stop executing?()