blob: bd3ef2f54b8444b7c4ec2c44210ded8b03e89563 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import com.artifex.gsjava.GSInstance;
import java.io.File;
public class Main {
public static final String INFILE = "../../../examples/tiger.eps";
public static void main(String[] args) {
GSInstance.setAllowMultithreading(true);
int workerCount = 10;
if (args.length > 0) {
try {
workerCount = Integer.parseInt(args[0]);
} catch (NumberFormatException e) { }
}
Worker[] workers = new Worker[workerCount];
for (int i = 0; i < workers.length; i++) {
workers[i] = new Worker(INFILE, "pdfout/out" + i + ".pdf");
}
System.out.println("Starting workers...");
for (int i = 0; i < workers.length; i++) {
workers[i].start();
}
}
}
|