Banu Chowdary wrote:Hi,
I have read threads chapter in K & S Book. I understood the topics. but I am not able to answer practical questions in the mock tests. But I am able to answer theoretical questions. But not practical especially Synchronization questions.. Any one please suggest me
I understand. Here are few tips
1. See for sleep, join and wait from within try catch block as they throw Interrupted Exceptions
2. Learn that sleep & yield are static and throw interrupted exception. the ThreadName.sleep and ThreadName.yield don't depend on ThreadName. They act on current thread
3. Learn that wait, notify and notifyall must be called from synchronised context
4. Learn that threads must hold lock on the object on which wait, notify and notifyall is called
5. Synchronised methods don't interefre with Non-synchronised
6. Synchronised methods of threads acting on DIFFERENT Objects won't interefere with one another.
Anyone is free to ADD