#include #include #include #include #include "bench.h" volatile int go = 0; monitor M {}; M m1; void __attribute__((noinline)) call( M & mutex a1 ) {} int __attribute__((noinline)) wait( M & mutex a1 ) { go = 1; for ( i; times ) { waitfor(call, a1); } go = 0; return 0; } thread T {}; void ^?{}( T & mutex this ) {} void main( T & ) { while(go == 0) { yield(); } BENCH( while(go == 1) { call(m1); }, result ) printf( "%g\n", result ); } int main( int argc, char * argv[] ) { BENCH_START() T t; return wait( m1 ); } // Local Variables: // // tab-width: 4 // // End: //