Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

thread problem @@

Status
Not open for further replies.

newbieKing

Programmer
Jan 29, 2003
19
CA
Hello,
I'm trying to execute a bunch of threads in the inner loop but only one batch of inner threads at a time. How do I stop the outer loop until the inner loop threads finish running?

Thanks in advance!

Outline:

outer
{
not concurrent
inner{
executes
concurrent threads
}


}
 
I think you should ellaborate it a little bit more. I personally don't understand what are you talking about.

Anyway, I think I can give you tow staring points.

synchronized ditective in Java :
And join() method in Thread class: java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html

Cheers,

Dian
 
outer
{
myThread.start();
inner{
myThread.run();
}


}

The start() method kicks a thread off, and then returns immediately (in effect detaches thread from the current line of execution).

The run() method kicks of the thread and then does a join() which means the current path of execution is joined with the threads line aswell.

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top