source: benchmark/schedext/upp.cc @ 580c11b

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 580c11b 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: 550 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};
20
21M m;
22
23_Task T {
24        void main() {
25                while(go == 0) { yield(); }
26                BENCH(
27                        while(go == 1) { m.call(); },
28                        result
29                )
30                printf( "%g\n", result );
31        }
32};
33
34int main( int argc, char * argv[] ) {
35        BENCH_START()
36        T t;
37        return m.wait();
38}
39
40// Local Variables: //
41// tab-width: 4 //
42// End: //
Note: See TracBrowser for help on using the repository browser.