Ignore:
Timestamp:
Oct 26, 2017, 12:16:10 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
6395817
Parents:
4149d9d
Message:

Updated the creation and ctxswitch benchmark to all be consistent and flexible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/benchmark/ctxswitch/cfa_cor.c

    r4149d9d rb7170a64  
    1 #include <fstream>
    2 #include <stdlib>
     1#include <stdio.h>
    32#include <thread>
    43
     
    1110}
    1211
    13 void main( GreatSuspender & this )
    14 {
     12void main( GreatSuspender & this ) {
    1513        while( true ) {
    1614                suspend();
    17         }
    18 }
    19 
    20 void resumer( GreatSuspender & this, const unsigned int NoOfTimes ) {
    21         for ( volatile unsigned int i = 0; i < NoOfTimes; i += 1 ) {
    22                 resume( this );
    2315        }
    2416}
     
    2820
    2921        BENCH(
    30                 resumer( s, NoOfTimes );,
     22                for (size_t i = 0; i < n; i++) {
     23                        resume( s );
     24                },
    3125                result
    3226        )
    3327
    34         sout | result | endl;
     28        printf("%llu\n", result);
    3529}
Note: See TracChangeset for help on using the changeset viewer.