Changeset b4107c8 for benchmark/schedint
- Timestamp:
- Jan 7, 2020, 3:50:56 PM (3 years ago)
- Branches:
- ADT, arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 580c11b
- Parents:
- 846c026
- Location:
- benchmark/schedint
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/schedint/JavaThread.java
r846c026 rb4107c8 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; … … 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: // -
benchmark/schedint/cfa1.cfa
r846c026 rb4107c8 6 6 #include "bench.h" 7 7 8 int argc;9 char** argv;10 8 volatile int go = 0; 11 9 … … 26 24 result 27 25 ) 28 29 printf("%g\n", result); 26 printf( "%g\n", result ); 30 27 go = 0; 31 28 return 0; … … 40 37 } 41 38 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 39 int main( int argc, char * argv[] ) { 40 BENCH_START() 43 41 T t; 44 42 return wait(m1); 45 43 } 44 45 // Local Variables: // 46 // tab-width: 4 // 47 // End: // -
benchmark/schedint/cfa2.cfa
r846c026 rb4107c8 6 6 #include "bench.h" 7 7 8 int argc;9 char** argv;10 8 volatile int go = 0; 11 9 … … 26 24 result 27 25 ) 28 29 printf("%g\n", result); 26 printf( "%g\n", result ); 30 27 go = 0; 31 28 return 0; … … 40 37 } 41 38 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 39 int main( int argc, char * argv[] ) { 40 BENCH_START() 43 41 T t; 44 42 return wait(m1, m2); 45 43 } 44 45 // Local Variables: // 46 // tab-width: 4 // 47 // End: // -
benchmark/schedint/cfa4.cfa
r846c026 rb4107c8 6 6 #include "bench.h" 7 7 8 int argc;9 char** argv;10 8 volatile int go = 0; 11 9 … … 26 24 result 27 25 ) 28 29 printf("%g\n", result); 26 printf( "%g\n", result ); 30 27 go = 0; 31 28 return 0; … … 40 37 } 41 38 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 39 int main( int argc, char * argv[] ) { 40 BENCH_START() 43 41 T t; 44 42 return wait(m1, m2, m3, m4); 45 43 } 44 45 // Local Variables: // 46 // tab-width: 4 // 47 // End: // -
benchmark/schedint/pthreads.c
r846c026 rb4107c8 4 4 #include "bench.h" 5 5 6 int argc;7 char** argv;8 6 volatile int go = 0; 9 7 … … 21 19 go = 1; 22 20 BENCH( 23 for (size_t i = 0; i < n; i++) {21 for (size_t i = 0; i < times; i++) { 24 22 pthread_cond_wait(&c, &m); 25 23 }, 26 24 result 27 25 ) 28 29 printf("%g\n", result); 26 printf( "%g\n", result ); 30 27 go = 0; 31 28 pthread_mutex_unlock(&m); … … 39 36 } 40 37 41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 38 int main( int argc, char * argv[] ) { 39 BENCH_START() 42 40 pthread_t thread; 43 41 if (pthread_create(&thread, NULL, thread_main, NULL) < 0) { … … 50 48 return 1; 51 49 } 52 return 0;53 50 } 51 52 // Local Variables: // 53 // tab-width: 4 // 54 // End: // -
benchmark/schedint/upp.cc
r846c026 rb4107c8 3 3 #include "bench.h" 4 4 5 int argc;6 char** argv;7 5 volatile int go = 0; 8 6 … … 22 20 result 23 21 ) 24 25 printf("%g\n", result); 22 printf( "%g\n", result ); 26 23 go = 0; 27 24 return 0; … … 39 36 }; 40 37 41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 38 int main( int argc, char * argv[] ) { 39 BENCH_START() 42 40 T t; 43 41 return m.wait(); 44 42 } 43 44 // Local Variables: // 45 // tab-width: 4 // 46 // End: //
Note: See TracChangeset
for help on using the changeset viewer.