source: benchmark/schedint/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 6e540ea, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

additional corrections to harmonize with last benchmark update

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