• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

to maha - yield() method

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Maha.
Got it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic