source: benchmark/schedint/upp.cc @ b4107c8

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since b4107c8 was b4107c8, checked in by Peter A. Buhr <pabuhr@…>, 4 years ago

update existing benchmarks for changes to bench.h, add new benchmarks in new programming languages

  • Property mode set to 100644
File size: 584 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 < n; 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.