968970 wrote:you don't implement invokeAll(), ThreadPoolExecutor does. it is just a shorthand method for submitting all your tasks if you already have them in a Collection.
I am thinking to use ThreadPoolExecutor and will create specific task for my utility program. But i am confused that should i first create a list of all my task having my account and invoke the method invokeAll(taskList). And in invokeAll Should I loop through all my accounts and invoke the run method on the Callable task.
Also, i want to know that how can i find out that actually my program is multithreaded and its behaving in the same manner?if you want to go low tech, you can print out progress info from each task and see that they are running in parallel. or, you could attach a profiler to the java process and watch the threads in action.