A question on wait().
posted 8 years ago
Imagine that you are standing in a crowd to meet a VIP one-on-one. Everyone is rushing in to meet him/her. Now who should say - "Hey!wait.. come in a queue" ?? You(i mean, one of the waiting people) or the VIP(or his/her bodyguards) ?? Similar case for object and threads. Many threads try to access the object and only the object says - wait or next(notify). Pretty good question actually