Changeset 26fd986 for benchmark/schedext


Ignore:
Timestamp:
Jan 21, 2020, 6:14:34 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
5518719
Parents:
c12869e
Message:

update benchmarks for concurrency paper

Location:
benchmark/schedext
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • benchmark/schedext/cfa1.cfa

    rc12869e r26fd986  
    66#include "../bench.h"
    77
    8 volatile int go = 0;
    9 
    108monitor M {} m1;
    119
    1210void __attribute__((noinline)) call( M & mutex p1 ) {}
    13 
    1411void __attribute__((noinline)) wait( M & mutex p1 ) {
    15         go = 1;
    1612        for ( times ) {
    1713                waitfor( call : p1 );
    1814        }
    19         go = 0;
    2015}
    2116
    2217thread T {};
    2318void main( T & ) {
    24         while ( go == 0 ) { yield(); }
    2519        BENCH(
    26                 while ( go == 1 ) { call( m1 ); },
     20                for ( times ) { call( m1 ); },
    2721                result
    2822        )
  • benchmark/schedext/cfa2.cfa

    rc12869e r26fd986  
    44#include <stdio.h>
    55
    6 #include "bench.h"
    7 
    8 volatile int go = 0;
     6#include "../bench.h"
    97
    108monitor M {} m1, m2;
    119
    1210void __attribute__((noinline)) call( M & mutex p1, M & mutex p2 ) {}
    13 
    1411void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2 ) {
    15         go = 1;
    1612        for ( times ) {
    1713                waitfor( call : p1, p2 );
    1814        }
    19         go = 0;
    2015}
    21 
    2216thread T {};
    2317void main( T & ) {
    24         while( go == 0 ) { yield(); }
    2518        BENCH(
    26                 while ( go == 1 ) { call( m1, m2 ); },
     19                for ( times ) {
     20                        call( m1, m2 );
     21                },
    2722                result
    2823        )
  • benchmark/schedext/cfa4.cfa

    rc12869e r26fd986  
    44#include <stdio.h>
    55
    6 #include "bench.h"
    7 
    8 volatile int go = 0;
     6#include "../bench.h"
    97
    108monitor M {} m1, m2, m3, m4;
    119
    1210void __attribute__((noinline)) call( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {}
    13 
    1411void __attribute__((noinline)) wait( M & mutex p1, M & mutex p2, M & mutex p3, M & mutex p4 ) {
    15         go = 1;
    1612        for ( times ) {
    1713                waitfor( call : p1, p2, p3, p4 );
    1814        }
    19         go = 0;
    2015}
    21 
    2216thread T {};
    2317void main( T & ) {
    24         while( go == 0 ) { yield(); }
    2518        BENCH(
    26                 while( go == 1 ) { call( m1, m2, m3, m4 ); },
     19                for ( times ) {
     20                        call( m1, m2, m3, m4 );
     21                },
    2722                result
    2823        )
  • benchmark/schedext/upp.cc

    rc12869e r26fd986  
    33#include "bench.h"
    44
    5 volatile int go = 0;
    6 
    75_Monitor M {
    86public:
    97        void __attribute__((noinline)) call() {}
    10 
    11         int __attribute__((noinline)) wait() {
    12                 go = 1;
     8        void __attribute__((noinline)) wait() {
    139                for ( size_t i = 0; i < times; i++ ) {
    1410                        _Accept(call);
    1511                }
    16                 go = 0;
    17                 return 0;
    1812        }
    1913} m;
     
    2115_Task T {
    2216        void main() {
    23                 while ( go == 0 ) { yield(); }
    2417                BENCH(
    25                         while ( go == 1 ) { m.call(); },
     18                        for ( size_t i = 0; i < times; i++ ) {
     19                                m.call();
     20                        },
    2621                        result
    2722                )
     
    3328        BENCH_START()
    3429        T t;
    35         return m.wait();
     30        m.wait();
    3631}
    3732
Note: See TracChangeset for help on using the changeset viewer.