source: src/benchmark/schedext/upp.cc @ 6a5be52

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 6a5be52 was 9f0b975, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

added behcnmarks for signal and waitfor

  • Property mode set to 100644
File size: 547 bytes
Line 
1#include <cstdio>
2
3#include "bench.h"
4
5int argc;
6char** argv;
7volatile int go = 0;
8
9_Monitor M {
10public:
11        void __attribute__((noinline)) call() {}
12
13        int __attribute__((noinline)) wait() {
14                go = 1;
15                BENCH(
16                        for (size_t i = 0; i < n; i++) {
17                                _Accept(call);
18                        },
19                        result
20                )
21
22                printf("%llu\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 margc, char* margv[]) {
39        argc = margc;
40        argv = margv;
41        uProcessor p;
42        T t;
43        return m.wait();
44}
Note: See TracBrowser for help on using the repository browser.