posted 24 years ago
From Khalid Mughal book:
"- Waiting state:When in Running state , a thread can call the wait() method defined in Object [ !!! -V.K.] class to put itself unto the Waiting state. It must be notified by another thread, in order to move to the Ready - to- run state .
- Sleeping state: A call to the static method sleep() in the Thead (!!! - V.K.) class couses the current thread in Running state to transit to the Sleeping state. It wakes up after specified amount of time(...)
-Ready - to-run state: (...)In the Ready - to run state , a thread awaits its turn to get CPU time."
Those methods provides absolutely different functionality of threads. Sleep() makes thread to run with intevals, wait()[ and notify()] controls accessibility of synchronized methods of object for competing ( more then one) threads.