source: benchmark/ctxswitch/cfa_cor_then.cfa @ fefd77a

ADTast-experimentalenumpthread-emulationqualifiedEnum
Last change on this file since fefd77a was 2316525, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago

update benchmarks for concurrency paper

  • Property mode set to 100644
File size: 427 bytes
RevLine 
[5b11c25]1#include <kernel.hfa>
2#include <thread.hfa>
3
4#include "bench.h"
5
6void noOp(void) {}
7
[2316525]8coroutine C {} c;
[5b11c25]9
[2316525]10void ?{}( C & this ) {
[5b11c25]11        prime(this);
12}
13
[2316525]14void main( __attribute__((unused)) C & this ) {
15        while () {
[5b11c25]16                suspend_then(noOp);
17        }
18}
19
[b4107c8]20int main( int argc, char * argv[] ) {
21        BENCH_START()
[5b11c25]22        BENCH(
[2316525]23                for ( times ) {
24                        resume( c );
[5b11c25]25                },
26                result
27        )
[b4107c8]28        printf( "%g\n", result );
[dc33b5b]29}
[b4107c8]30
31// Local Variables: //
32// tab-width: 4 //
33// End: //
Note: See TracBrowser for help on using the repository browser.