This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Threads" Watch "Threads" New topic
Author

Threads

Balaji Bang
Ranch Hand

Joined: Apr 23, 2007
Posts: 180
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
Ruben Soto
Ranch Hand

Joined: Dec 16, 2008
Posts: 1032
The answer is simple: You need to practice more. Go through examples and try to figure them out. It takes a lot of practice, and I am afraid that theoretical knowledge is only a part of the equation.


All code in my posts, unless a source is explicitly mentioned, is my own.
Prav sharma
Ranch Hand

Joined: Feb 07, 2005
Posts: 102
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


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Threads
 
Similar Threads
Disable HTTP in TOMCAT 5.5.x
Help needed in Threads !!!!!
Thread Questions
Will be away at Training next week.
Rules Roundup needs Updating (to Java 6) ... Need New Questions (& Answers)