What CAN directly cause a thread to stop executing? A. Existing from a synchronized block B. Calling the wait method on an object C. Calling notify method on an object D. Calling read method on an InputStream object E. Calling the SetPriority method on a Thread object Can somebody help me with this one? Thank you. An other question, while a thread is running (already got the CUP), it that possible that other tread with higher priority (in Ready-to-Run state) takes over?
A. Existing from a synchronized block: No it does not gaurantee that thread will stop executing. B. Calling the wait method on an object Yes thread will stop executing, leave the monitor C. Calling notify method on an object No it does not gaurantee that thread will stop executing. D. Calling read method on an InputStream object Thread will not stop executing but will be in blocked state(I do not know whether it will come under not executing state.) E. Calling the SetPriority method on a Thread object will depend on OS. CMIW ------------------ Regards Ravish
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
A:FALSE B:TRUE C:FALSE D:One cant say that does the i/p task is completed as it is required by thread or it has to wait.In 2nd condition it goes to wait state & it's execution stops. E:FALSE ------------------ Count the flowers of ur garden,NOT the leafs which falls away!