I'm quite new to multithreading and this is what I want to do:
How can I check if all my started threads have finished?
I start them by doing this
for (Auftrag auftrag: auftragsliste) {
RunnableFS thread = new RunnableFS(auftrag, optionen, elmafs);
thread.start();
}
// I want to do something here after all my above started threads have finished
I know that by thread.join()
I could implement a point where the mainthread waits until the other one has finished. But if I do this in the for-loop I'm back to single threaded :(