Changeset b7d6a36 for benchmark/schedint/JavaThread.java
- Timestamp:
- Feb 20, 2020, 4:15:51 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6a490b2
- Parents:
- dca5802 (diff), 2cbfe92 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/schedint/JavaThread.java
rdca5802 rb7d6a36 49 49 static int x = 2; 50 50 51 static private final int NoOfTimes = Integer.parseInt("1000000");51 static private int times = Integer.parseInt("1000000"); 52 52 53 53 public static void helper( Monitor m ) throws InterruptedException { 54 for(int i = 1; i <= NoOfTimes; i += 1) {54 for(int i = 1; i <= times; i += 1) { 55 55 m.wait(); // relase monitor lock 56 56 m.next = true; … … 63 63 synchronized(m) { 64 64 s.start(); 65 while( ! Monitor.go ) {65 while( ! Monitor.go ) { // waiter must start first 66 66 Thread.yield(); 67 67 } … … 72 72 Monitor.go = false; 73 73 s.join(); 74 System.out.println( (end - start) / NoOfTimes);74 System.out.println( (end - start) / times); 75 75 } 76 76 public static void main(String[] args) throws InterruptedException { 77 if ( args.length > 2 ) System.exit( 1 ); 78 if ( args.length == 2 ) { times = Integer.parseInt(args[1]); } 79 77 80 for (int n = Integer.parseInt("5"); --n >= 0 ; ) { 78 81 InnerMain(); … … 83 86 } 84 87 } 88 89 // Local Variables: // 90 // tab-width: 4 // 91 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.