Hi all, According to knB of page 508, it mentions that "stopping threads from executing" means "moving a thread to a nonrunnable state". Could someone advise me if I'm right with the following statements? Conditions that stop a thread from executing: sleep(), wait(), join(), blocked because it needs an object locks Conditions NOT counted as stopping a thread from executing: yield(), another thread is given higher priority Thanks Joyce
posted 13 years ago
Hmm.. yes, yield() does not guarantee that the thread will move from the running to runnable state. And if it does, the same thread might be chosen again to the running state.
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury