Changeset b7d6a36 for benchmark/schedext/cfa2.cfa
- 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/schedext/cfa2.cfa
rdca5802 rb7d6a36 4 4 #include <stdio.h> 5 5 6 #include " bench.h"6 #include "../bench.h" 7 7 8 int argc; 9 char** argv; 10 volatile int go = 0; 8 monitor M {} m1, m2; 11 9 12 monitor M {}; 13 M m1, m2; 14 15 void __attribute__((noinline)) call( M & mutex a1, M & mutex a2 ) {} 16 17 int __attribute__((noinline)) wait( M & mutex a1, M & mutex a2 ) { 18 go = 1; 10 void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {} 11 void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) { 12 for ( times ) { 13 waitfor( call : p1, p2 ); 14 } 15 } 16 thread T {}; 17 void main( T & ) { 19 18 BENCH( 20 for ( i; n) {21 waitfor(call, a1, a2);19 for ( times ) { 20 call( m1, m2 ); 22 21 }, 23 22 result 24 23 ) 25 26 printf("%g\n", result); 27 go = 0; 28 return 0; 24 printf( "%g\n", result ); 29 25 } 30 26 31 thread T {}; 32 void ^?{}( T & mutex this ) {} 33 void main( T & ) { 34 while(go == 0) { yield(); } 35 while(go == 1) { call(m1, m2); } 36 27 int main( int argc, char * argv[] ) { 28 BENCH_START() 29 T t; 30 wait( m1, m2 ); 37 31 } 38 32 39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 40 T t; 41 return wait(m1, m2); 42 } 33 // Local Variables: // 34 // tab-width: 4 // 35 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.