Learning about notifyAll made me question something about notify: in a typical situation we have several threads which are waiting for a call to the methody notify. When this happens one of those thread (which previously invoked the wait method) is awaken and continues its work; my question is: what about the others? Do they get the lock from the object one after one or they simply got lost? I’ve seen a lot of emphasis on the fact that using notify there will be just one thread that goes on, but I’ve never read what happens to the other threads…
Learning about notifyAll made me question something about notify: in a typical situation we
Share
They keep waiting for the next call to
notify()/notifyAll(), just as if nothing happened.