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:
parent
80e8df59d6
commit
b7371b1ac2
5 changed files with 220 additions and 0 deletions
|
@ -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();
|
Loading…
Add table
Add a link
Reference in a new issue