Muhammad Khojaye wrote:For Wait/Notify usage, you need to synchronize on shared monitor object. In your case, you are using one method but calling from different object.
He actually only has one Runner instance, which is where all the work is done, so he is good there, he can use the Runner for synchronization.
What I don't get is what do you need wait() and notify() for? Wait and notify are for inter-thread signaling. If all you want is to make sure the count gets incremented safely, all you need is synchronization. Is there some reason you need signaling as well?