Related questions
Where to catch Exceptions thrown from Callable.call()
Possible Duplicate:
Handling exceptions from Java ExecutorService tasks
I use the ExecutorService from Java for coordinating Threads.
For starting the threads I use
pool = new ExecutorService(2);
callableResults = pool.invokeAll(threads);
To collect the result, I use future.get() for each …
How to wait for all threads to finish, using ExecutorService?
I need to execute some amount of tasks 4 at a time, something like this:
ExecutorService taskExecutor = Executors.newFixedThreadPool(4);
while(...) {
taskExecutor.execute(new MyTask());
}
//...wait for completion somehow
How can I get notified once all of them are complete? For now …