Java: ExecutorService with Callables: invokeAll() and future.get() - results in correct order?
问题 Im using the ExecutorService in Java to invoke Threads with invokeAll() . After, I get the result set with future.get() . Its really important that I receive the results in the same order I created the threads. Here is a snippet: try { final List threads = new ArrayList(); // create threads for (String name : collection) { final CallObject object = new CallObject(name); threads.add(object); } // start all Threads results = pool.invokeAll(threads, 3, TimeUnit.SECONDS); for (Future<String>