Re: Thread-end monitoring



Hello,

Depending on how your threads are arranged, you can use a CountdownLatch
or a CyclicBarrier from the java.util.concurrent package.

Thank you for your quick answer. I have looked at both of the classes
and it seems that both are inappropriate for my case. CountdownLeach is
not good, because at the beginning I do not know the number of the
created threads (that number can changes depending on the execution of
the threads). Cyclic barrier is also not good, because I just want to
check the situation when the thread finish (I am not going to resume it
again) so using it I think will make java to keep every thread running
and what I want is just to allow the garbage collector to remove them
just to create a space for a new threads. If I am wrong please tell me.

Regards, mark

.