What is the difference between yielding and sleeping?

Q

What is the difference between yielding and sleeping?

✍: Guest

A

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.

2012-06-15, 2241👍, 0💬