source: src/benchmark/schedint/cfa1.c @ e706bfd

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 e706bfd was bb7e3d4, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Removed second processor in scheduling benchmark, since it was creating too much contention

  • Property mode set to 100644
File size: 654 bytes
Line 
1#include <kernel>
2#include <monitor>
3#include <thread>
4#include <stdio.h>
5
6#include "bench.h"
7
8int argc;
9char** argv;
10volatile int go = 0;
11
12condition c;
13monitor M {};
14M m1;
15
16void __attribute__((noinline)) call( M & mutex a1 ) {
17        signal(&c);
18}
19
20int  __attribute__((noinline)) wait( M & mutex a1 ) {
21        go = 1;
22        BENCH(
23                for (size_t i = 0; i < n; i++) {
24                        wait(&c);
25                },
26                result
27        )
28
29        printf("%llu\n", result);
30        go = 0;
31        return 0;
32}
33
34thread T {};
35void ^?{}( T & mutex this ) {}
36void main( T & this ) {
37        while(go == 0) { yield(); }
38        while(go == 1) { call(m1); }
39
40}
41
42int main(int margc, char* margv[]) {
43        argc = margc;
44        argv = margv;
45        T t;
46        return wait(m1);
47}
Note: See TracBrowser for help on using the repository browser.