2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00

Java hinzugefügt

This commit is contained in:
Martin Thoma 2014-03-24 17:04:40 +01:00
parent 80e8df59d6
commit b7371b1ac2
5 changed files with 220 additions and 0 deletions

View file

@ -0,0 +1,17 @@
public final class StringTask implements Runnable {
int id;
public StringTask(int id) {
this.id = id;
}
public void run() {
// do calculation
}
}
ExecutorService pool =
Executors.newFixedThreadPool(4);
for(int i = 0; i < 10; i++){
pool.execute(new StringTask(i));
}
pool.shutdown();
executor.awaitTermination();