void notify() |
void notifyAll()
|
notify() notifies the thread associated with the given synchronization object that has been waiting the longest time |
notifyAll() notifies all threads associated with the given object and is therefore safer than notify() |
One can mark a variable as "threadsafe" to inform the compiler that only one thread will be modifying this variable. |