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;
22 mid[0] = (128<<24)|(195<<16)|(136<<8)|162;
23 mid[1] = (128<<24)|(195<<16)|(136<<8)|163;
24 mid[2] = (128<<24)|(195<<16)|(136<<8)|164;
27 firstmachine = global new GlobalString(args[1]);
29 works = global new Work[NUM_THREADS];
30 qt = global new QueryTask[NUM_THREADS];
31 currentWorkList = global new GlobalQuery[NUM_THREADS];
33 GlobalQuery firstquery = global new GlobalQuery(firstmachine);
35 Queue todoList = global new Queue();
36 DistributedHashMap doneList = global new DistributedHashMap(500, 500, 0.75f);
37 DistributedHashMap results = global new DistributedHashMap(100, 100, 0.75f);
39 todoList.push(firstquery);
41 for (i = 0; i < NUM_THREADS; i++) {
42 qt[i] = global new QueryTask(todoList, doneList, maxDepth, results);
43 works[i] = global new Work(qt[i], NUM_THREADS, i, currentWorkList);
46 System.printString("Finished to create Objects\n");
49 for (i = 0; i < NUM_THREADS; i++) {
53 Thread.myStart(tmp, mid[i]);
56 for (i = 0; i < NUM_THREADS; i++) {