source: src/benchmark/schedext/cfa4.c@ a378ca7

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since a378ca7 was bb7e3d4, checked in by Thierry Delisle <tdelisle@…>, 8 years ago

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

  • Property mode set to 100644
File size: 768 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
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(
20 for (size_t i = 0; i < n; i++) {
21 waitfor(call, a1, a2, a3, a4);
22 },
23 result
24 )
25
26 printf("%llu\n", result);
27 go = 0;
28 return 0;
29}
30
31thread T {};
32void ^?{}( T & mutex this ) {}
33void main( T & this ) {
34 while(go == 0) { yield(); }
35 while(go == 1) { call(m1, m2, m3, m4); }
36
37}
38
39int main(int margc, char* margv[]) {
40 argc = margc;
41 argv = margv;
42 T t;
43 return wait(m1, m2, m3, m4);
44}
Note: See TracBrowser for help on using the repository browser.