39. What is the difference between yield and sleeping


When a task invokes yield(), it changes from running state to runnable state. When a task invokes sleep(), it changes from running state to waiting/sleeping state.


No comments:

Post a Comment