Changes in benchmark/schedint/cfa1.cfa [26fd986:dc33b5b]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/schedint/cfa1.cfa
r26fd986 rdc33b5b 4 4 #include <stdio.h> 5 5 6 #include " ../bench.h"6 #include "bench.h" 7 7 8 int argc; 9 char** argv; 8 10 volatile int go = 0; 9 11 10 12 condition c; 11 monitor M {} m1; 13 monitor M {}; 14 M m1; 12 15 13 void __attribute__((noinline)) call( M & mutex p1 ) {14 signal( c);16 void __attribute__((noinline)) call( M & mutex a1 ) { 17 signal(c); 15 18 } 16 void __attribute__((noinline)) wait( M & mutex p1 ) { 19 20 int __attribute__((noinline)) wait( M & mutex a1 ) { 17 21 go = 1; 18 for ( times ) { 19 wait( c ); 20 } 22 BENCH( 23 for ( i; n ) { 24 wait(c); 25 }, 26 result 27 ) 28 29 printf("%g\n", result); 30 go = 0; 31 return 0; 21 32 } 22 33 23 34 thread T {}; 35 void ^?{}( T & mutex ) {} 24 36 void main( T & ) { 25 while ( go == 0 ) { yield(); } // waiter must start first 26 BENCH( 27 for ( times ) { call( m1 ); }, 28 result 29 ) 30 printf( "%g\n", result ); 37 while(go == 0) { yield(); } 38 while(go == 1) { call(m1); } 39 31 40 } 32 41 33 int main( int argc, char * argv[] ) { 34 BENCH_START() 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 35 43 T t; 36 wait( m1);44 return wait(m1); 37 45 } 38 39 // Local Variables: //40 // tab-width: 4 //41 // End: //
Note: See TracChangeset
for help on using the changeset viewer.