On a previous question of mine I posted:
I have to read several very large txt files and have to either use multiple threads or a single thread to do so depending on
So, the newFixedThreadPool()
call will return an instance of ExecutorService. You can reference the JavaDoc, which is pretty comprehensive and contains a workable example. You will want to either submit
or invokeAll
a number of Callable
s implementing your file-processing tasks, giving you a number of Future
s in return. Their get()
methods will give you the result of the task execution upon completion (you have to write that part yourself :))