source: benchmark/schedext/cfa4.cfa @ 98d6965d

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

update benchmarks and add benchmarks for qthreads

  • Property mode set to 100644
File size: 772 bytes
RevLine 
[73abe95]1#include <kernel.hfa>
2#include <monitor.hfa>
3#include <thread.hfa>
[9f0b975]4#include <stdio.h>
5
6#include "bench.h"
7
8int argc;
9char** argv;
10volatile int go = 0;
11
12monitor M {};
13M m1, m2, m3, m4;
14
15void __attribute__((noinline)) call( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {}
16
17int  __attribute__((noinline)) wait( M & mutex a1, M & mutex a2, M & mutex a3, M & mutex a4 ) {
18        go = 1;
19        BENCH(
[dc33b5b]20                for ( i; n ) {
[9f0b975]21                        waitfor(call, a1, a2, a3, a4);
22                },
23                result
24        )
25
[dc33b5b]26        printf("%g\n", result);
[9f0b975]27        go = 0;
28        return 0;
29}
30
31thread T {};
32void ^?{}( T & mutex this ) {}
[dc33b5b]33void main( T & ) {
[9f0b975]34        while(go == 0) { yield(); }
35        while(go == 1) { call(m1, m2, m3, m4); }
36
37}
38
[dc33b5b]39int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
[9f0b975]40        T t;
41        return wait(m1, m2, m3, m4);
[dc33b5b]42}
Note: See TracBrowser for help on using the repository browser.