source: doc/theses/colby_parsons_MMAth/benchmarks/mutex_stmt/cfa/order.cfa @ 0da7181

ADTast-experimental
Last change on this file since 0da7181 was 6e6989c, checked in by caparsons <caparson@…>, 16 months ago

added mutex stmt benchmarking

  • Property mode set to 100644
File size: 518 bytes
Line 
1#include <locks.hfa>
2#include <mutex_stmt.hfa>
3#include <stdio.h>
4
5#include "../bench.h"
6
7test_spinlock LOCKS;
8
9bool done = false;
10uint64_t total = 0;
11thread worker {};
12void main( worker & w ) {
13    BENCH( mutex ( LOCKS ) { }, total, done )
14}
15
16int main( int argc, char * argv[] ) {
17        BENCH_START()
18    processor p[threads]; // one extra for main thread
19    {
20        worker w[threads];
21        sleep( 10`s );
22        done = true;
23    }
24        printf( "%lu\n", total );
25}
26
27// Local Variables: //
28// tab-width: 4 //
29// End: //
Note: See TracBrowser for help on using the repository browser.