This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Threads Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Threads Question" Watch "Threads Question" New topic
Author

Threads Question

Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 787

Hello Ranchers

Please help me regrding this question

The question is from: Niko�s java blog:
http://nikojava.wordpress.com/2008/09/08/scjp-mock-exam-for-threads/

If Job thread is not started then program waits
but if Job thread started then without using notify
main thread comes out of wait state
why this happens?

Run the following code





Regards
Ninad


SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18754
    
  40

See this post for an explanation of what you are encountering...

http://www.coderanch.com/t/234368/threads/java/wait-without-notify

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 787

Hello
Henry Wong

I clearly understand the concept

Regards
Ninad

[ September 16, 2008: Message edited by: Ninad Kulkarni ]
[ September 16, 2008: Message edited by: Ninad Kulkarni ]
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 787

Thanks
Henry Wong

Regards
Ninad
 
Don't get me started about those stupid light bulbs.
 
subject: Threads Question