Hi All,
Can anybody explain me wait and notify with real scenario example in
java . I read many example on the internet but still not satisfied.
Thanks in advance.
Points which is not cleared.
How notify and wait are called on the same object?
Example: if there is 2
thread e.g t1 and t2
t1 going into waiting state because t2 want to use the same monitor . It leave the monitor.
After that , t2 has done its work and notify to t1 that you can use that monitor.
Then t2.notify() is informing t1 about the monitor that it is free.
If i give incorrect explantation .Please correct me .
Thanks.