Current page: p.102
There are three ways in controlling threads:- Waiting
Implicitly wait for competitive resources
Explicitly wait by calling myObject.wait();
--> myObject.notify(); or myObject.notifyAll(); can wake up waiting threads - Yielding
The thread gives up its order to other thread but doesn't release its resources!!
myThread.yield();
It's suitable for using it before processing a complicated task!! - Blocking
- Sleeping
Wait for at least a specified amount of time.