acilonv
asked on
Blocking Java Thread Pool
Hello,
I'm looking for the simplest way to have in Java a pool of threads with the ability to specify the maximum number of threads, know at any given time how many threads are running and know when all the threads have finished running.
Thank you.
I'm looking for the simplest way to have in Java a pool of threads with the ability to specify the maximum number of threads, know at any given time how many threads are running and know when all the threads have finished running.
Thank you.
ASKER
I tried using the ThreadPoolExecutor class but was unable to see how to check when the last threads.
How do you do that?
How do you do that?
>but was unable to see how to check when the last threads
When the last threads do what?
When the last threads do what?
ASKER
Oh, sorry. .... when it ends. How do I check when the last thread ends?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
no code provided
You can set the maximum number of threads, get the number of executing threads, and you can set a method to be invoked when a thread ends, where you can check if it is the last one.