previous |
start |
next
Restroom wait/notifyAll Analogy
- The thread calling wait corresponds to the person who enters
the restroom and finds there is no toilet paper
- The person then leaves the restroom and waits outside
- Other people may enter and leave, but the first person just
waits
- Eventually an attendant enters the restroom, refills the toilet
paper, and shouts a notification
- All the waiting people compete for the restroom
previous |
start |
next