Hi All, Which two donot cause a Thread to stop being the currently running thread?
A. calling the join() on a live thread B. calling the sleep() C. calling the wait() D. calling the notify() E. Entering an unlocked, sunchronized block of code. Are the options A & E correct ? Calling a notify() or notifyAll() releases the lock on the thread? Help me reshma [ April 02, 2003: Message edited by: Reshma Pai ] [ April 02, 2003: Message edited by: Reshma Pai ]
join can result in the current thread's detention only if the thread on which join was called has started and not ended yet. sleep and wait will always cause current thread's detention. notify wil never cause it. a synchronized block whose lock is not hold by any other thread will not prevent a thread from executing it. wait releases the monitor, notify not. You can find more information in the Java Tutorial at java.sun.com and the API. [ April 02, 2003: Message edited by: Jose Botella ]