» Home » Awakens » Page 1
Issuing notify on a single thread awakens all waiting threads
by Ph33zy in Programming Languages

Having three threads waiting on a 4th one, and the latter issuing a notify, all of the waiting threads are awakened.


Here is the source code:


class Reader extends Thread {
Calculator calc;
public Reader(Calculator calc) {
this.calc = calc;
}
public void run() {
synchronized(calc) {
try {
System.out.

Next
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .