source: benchmark/mutexC/upp.cc@ d1566d4

Last change on this file since d1566d4 was 51493a4, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

start directory for full-contention mutex tests

  • Property mode set to 100644
File size: 512 bytes
Line 
1#include <cstdio>
2
3#include "../bench.h"
4
5_Monitor MyMonitor {
6 public:
7 void __attribute__((noinline)) call() {}
8} m;
9
10volatile bool go = false;
11
12void call() {
13 go = true;
14 for ( size_t i = 0; i < times; i += 1 ) {
15 m.call();
16 }
17 go = false;
18}
19_Task T {
20 void main() {
21 while ( ! go );
22 while ( go ) { m.call(); }
23 }
24};
25int main( int argc, char * argv[] ) {
26 BENCH_START()
27 uProcessor p;
28 T t;
29 BENCH(
30 call(),
31 result
32 )
33 printf( "%g\n", result );
34}
35
36// Local Variables: //
37// tab-width: 4 //
38// End: //
Note: See TracBrowser for help on using the repository browser.