If I have T1 T2 T3 all have called wait and are in the waitset, if t4 calls notify, as I understand it - one of T1,T2 or T3 will be notified and will possibly reacquire the lock and return from wait. What happens to the threads that don't receive the notify ? Will they still be in the waitset ? Do they have to be notified again to return from wait() ?
If T4 calls notify all, only one of t1 T2 T3 will return from wait, after acquiring lock. In this case, since all of T1T2 and T3 have received notify, will they automatically try to acquire the lock and one by one return from wait ?