Call on:
- wait(): Call on an object; current thread must synchronize on the lock object.
- sleep(): Call on a Thread; always currently executing thread.
- wait(): when synchronized multiple threads access same Object one by one.
- sleep(): when synchronized multiple threads wait for sleep over of sleeping thread.
- wait(): release the lock for other objects to have chance to execute.
- sleep(): keep lock for at least t times if timeout specified or somebody interrupt.
- wait(): until call notify(), notifyAll() from object
- sleep(): until at least time expire or call interrupt().
- sleep(): for time-synchronization and;
- wait(): for multi-thread-synchronization.
No comments:
Post a Comment