Yielding | Sleeping |
Yield will causes the thread to rejoin the queue. | Sleep holds the thread's execution for the specified time. |
When a task is invoked in yielding, it returns to the ready state. | When a task is invoked in sleeping, it returns to the waiting state. |
It is used to get the running thread into out of runnable state with the same priority. | It is used to delay the execution for a period of time. |