source: benchmark/ctxswitch/cfa_thrd2.cfa @ ff2a33e

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since ff2a33e 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: 328 bytes
RevLine 
[73abe95]1#include <thread.hfa>
[6810fcb]2
3#include "bench.h"
4
5volatile bool done = false;
6
7thread Fibre {};
8
[ffe2fad]9void main(__attribute__((unused)) Fibre & this) {
[6810fcb]10        while(!done) {
11                yield();
12        }
13}
14
15int main(int argc, char* argv[]) {
16        Fibre f1;
17        BENCH(
[dc33b5b]18                for ( i; n ) {
[6810fcb]19                        yield();
20                },
21                result
22        )
23
[dc33b5b]24        printf("%g\n", result);
[6810fcb]25        done = true;
26        return 0;
[dc33b5b]27}
Note: See TracBrowser for help on using the repository browser.