Two Laptop Bag*
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


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: 791

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: 18874
    
  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: 791

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: 791

Thanks
Henry Wong

Regards
Ninad
 
GeeCON Prague 2014
 
subject: Threads Question