What is the difference between yielding and sleeping

Showing Answers 1 - 2 of 2 Answers

Pattukkottai Arun

  • Jul 21st, 2005
 

When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.  

  Was this answer useful?  Yes

Sumeeth R Tewar

  • Jul 12th, 2006
 

yield() is used on a thread object to relinquish resources allocated to it.

and sleep() is used to take a thread in a waiting state for the specified time in milliseconds.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions