Answer the question
In order to leave comments, you need to log in
How to find out if all threads (Thread) have completed?
I start threads through a for loop:
MyThrowClass throw;
for(String i: all) {
trow = new MyThrowClass(i);
trow.start()
MyContainer.getLength();
Answer the question
In order to leave comments, you need to log in
in a loop through the threads, call join () for each, after which you already write code that should work only after the completion of all threads.
trow.isAlive();
And if you need to wait until the thread is finished:trow.join();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question