2 public static void main(String[] args) {
8 GlobalQuery[] currentWorkList;
10 NUM_THREADS = Integer.parseInt(args[0]);
12 if (args.length == 3) {
13 maxDepth = Integer.parseInt(args[2]);
16 GlobalString firstmachine;
18 int mid[] = new int[NUM_THREADS];
19 mid[0] = (128<<24)|(195<<16)|(180<<8)|21;
20 mid[1] = (128<<24)|(195<<16)|(180<<8)|24;
21 mid[2] = (128<<24)|(195<<16)|(180<<8)|26;
24 firstmachine = global new GlobalString(args[1]);
26 works = global new Work[NUM_THREADS];
27 qt = global new QueryTask[NUM_THREADS];
28 currentWorkList = global new GlobalQuery[NUM_THREADS];
30 GlobalQuery firstquery = global new GlobalQuery(firstmachine);
32 Queue todoList = global new Queue();
33 DistributedHashMap doneList = global new DistributedHashMap(500, 500, 0.75f);
34 DistributedHashMap results = global new DistributedHashMap(100, 100, 0.75f);
36 todoList.push(firstquery);
38 for (i = 0; i < NUM_THREADS; i++) {
39 qt[i] = global new QueryTask(todoList, doneList, maxDepth, results);
40 works[i] = global new Work(qt[i], NUM_THREADS, i, currentWorkList);
43 System.printString("Finished to create Objects\n");
46 for (i = 0; i < NUM_THREADS; i++) {
50 Thread.myStart(tmp, mid[i]);
53 for (i = 0; i < NUM_THREADS; i++) {