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 mains says :Hey thread jon me !!! 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 "mains says :Hey thread jon me !!!" Watch "mains says :Hey thread jon me !!!" New topic
Author

mains says :Hey thread jon me !!!

Sahil Kapoor
Ranch Hand

Joined: Sep 12, 2009
Posts: 316
Well, i read that , if we write t1.join() in a main method() where t1 is an instance of thread, then it implies

1. main thread would be moved from Running state to Blocked state with guarantee and would wait for an event of completion of t1 thread.

Problem :- Suppose , i want to say in some thread that join main, then how to do so ???


Thanks !!!


SCJP 6.0 96%

(Connecting the Dots ....)
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

In that case that other thread will need the main thread's instance to call join on. Something like this


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Sahil Kapoor
Ranch Hand

Joined: Sep 12, 2009
Posts: 316
Thanks Ankit....
Great explanation !!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mains says :Hey thread jon me !!!