Author Topic:   to maha - yield() method
eram
ranch hand
posted March 15, 2000 01:56 PM             
Does yield() method 'always' cause the current running thread to move to only 'Ready state' and not to 'waiting state' , even if there are other threads in ready state ?
Is it so with wait() and interrupt() as provided by maha anna ?

maha anna
bartender
posted March 15, 2000 03:13 PM             
eram,
One request first. You need not post new topic every time if the qstn is related to a previous qstn. This discussion forum is designed such that , if there is any new reply for any post, that thread will show up in different color so that we know someone has asked something new.

So you just reply to the same post which you are referring to.

Regarding the yield() , the thread which yields() (it yields to other threads of SAME PRIORITY) goes direct to the ready state. Now it is the schedulder's decision to pick up this thread for running.
When a thread calls wait() method , it goes to the waiting state.After waiting is over (if wait(miilisec)/wait(millisec,nanosec) is called then waiting will be over after such interval given in th arg to wait()/ it's been notified by other an thread ) it goes to Ready state.
regds
maha anna

[This message has been edited by maha anna (edited March 15, 2000).]

eram
ranch hand
posted March 15, 2000 03:16 PM             
Thanks Maha.
Got it.

|