source: benchmark/schedext/upp.cc@ 5ee7d36

ADT arm-eh ast-experimental enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr pthread-emulation qualifiedEnum
Last change on this file since 5ee7d36 was 2316525, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

update benchmarks for concurrency paper

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