source: benchmark/ctxswitch/cfa_thrd2.cfa@ 3e93c00

ADT arm-eh ast-experimental enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr pthread-emulation qualifiedEnum
Last change on this file since 3e93c00 was dc33b5b, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

update benchmarks and add benchmarks for qthreads

  • Property mode set to 100644
File size: 328 bytes
Line 
1#include <thread.hfa>
2
3#include "bench.h"
4
5volatile bool done = false;
6
7thread Fibre {};
8
9void main(__attribute__((unused)) Fibre & this) {
10 while(!done) {
11 yield();
12 }
13}
14
15int main(int argc, char* argv[]) {
16 Fibre f1;
17 BENCH(
18 for ( i; n ) {
19 yield();
20 },
21 result
22 )
23
24 printf("%g\n", result);
25 done = true;
26 return 0;
27}
Note: See TracBrowser for help on using the repository browser.