Changeset ce9f9d4


Ignore:
Timestamp:
Sep 16, 2021, 2:19:57 PM (2 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
a8367eb
Parents:
a5d1fe7
Message:

added mutexstmt benchmark to make

Location:
benchmark
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • benchmark/Makefile.am

    ra5d1fe7 rce9f9d4  
    372372        chmod a+x a.out
    373373
     374## =========================================================================================================
     375
    374376mutexStmt$(EXEEXT) :                \
     377        mutexStmt-cpp1.run                      \
     378        mutexStmt-cpp2.run                      \
     379        mutexStmt-cpp4.run                      \
     380        mutexStmt-cpp8.run                      \
     381        mutexStmt-java.run                      \
    375382        mutexStmt-lock1.run                 \
    376383        mutexStmt-lock2.run                 \
     
    397404        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/lock8.cfa
    398405
     406mutexStmt-cpp1$(EXEEXT):
     407        $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp1.cc
     408
     409mutexStmt-cpp2$(EXEEXT):
     410        $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp2.cc
     411
     412mutexStmt-cpp4$(EXEEXT):
     413        $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp4.cc
     414
     415mutexStmt-cpp8$(EXEEXT):
     416        $(BENCH_V_CXX)$(CXXCOMPILE) -std=c++17 $(srcdir)/mutexStmt/cpp8.cc
     417
    399418mutexStmt-monitor1$(EXEEXT):
    400419        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/monitor1.cfa
     
    417436mutexStmt-no-stmt-lock8$(EXEEXT):
    418437        $(BENCH_V_CFA)$(CFACOMPILE) $(srcdir)/mutexStmt/no_stmt_lock8.cfa
     438
     439mutexStmt-java$(EXEEXT):
     440        $(BENCH_V_JAVAC)javac -d $(builddir) $(srcdir)/mutexStmt/JavaThread.java
     441        echo "#!/bin/sh" > a.out
     442        echo "java JavaThread \"$$""@\"" >> a.out
     443        chmod a+x a.out
    419444
    420445## =========================================================================================================
  • benchmark/bench.h

    ra5d1fe7 rce9f9d4  
    2121        return 1000000000LL * ts.tv_sec + ts.tv_nsec;
    2222} // bench_time
     23
     24
     25#if defined(__cforall)
     26struct test_spinlock {
     27        volatile bool lock;
     28};
     29
     30static inline void lock( test_spinlock & this ) {
     31        for ( ;; ) {
     32                if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break;
     33        }
     34}
     35
     36static inline void unlock( test_spinlock & this ) {
     37        __atomic_clear( &this.lock, __ATOMIC_RELEASE );
     38}
     39#endif
    2340
    2441#ifndef BENCH_N
Note: See TracChangeset for help on using the changeset viewer.