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