4
I have the following problem, where I have one for()
that opens 17 threads and needs to recover, in another thread ( 18ª ) the active threads that I opened earlier and verify which of the 17 are still active.
I took a look through the internet, but I couldn’t find any plausible solution to my problem.
What would be the best solution to recover the active threads I opened earlier?
Follow the Code:
for(int i = 1; i <= 500; i+=30){
Runnable r = new Async(empresa,i,30);
Thread t = new Thread(r);
t.start();
}
There’s a way you can add how you’re doing this(start the 17 threads)?
– user28595
Could add the treads to an array
– Guilherme Nascimento
Possible solution: http://stackoverflow.com/a/26540115/5524514
– user28595
Thank you William and Diego.
– Matheus