2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00
This commit is contained in:
Martin Thoma 2014-03-24 18:55:32 +01:00
parent b7371b1ac2
commit 11f76e1a6e
4 changed files with 55 additions and 8 deletions

View file

@ -0,0 +1,18 @@
public static void main(String[] args) throws
InterruptedException, ExecutionException {
ExecutorService pool =
Executors.newFixedThreadPool(4);
List<Future<String>> futures =
new ArrayList<Future<String>>();
for(int i = 0; i < 10; i++) {
futures.add(pool.submit(new StringTask(i)));
}
for(Future<String> future : futures){
String result = future.get();
System.out.println(result);
}
pool.shutdown();
}