#include #include #include #include "../bench.h" test_spinlock LOCKS; bool done = false; uint64_t total = 0; thread worker {}; static inline void ?{}( worker & this, cluster & clu ) { ((thread &)this){ clu }; } void main( worker & w ) { BENCH( mutex ( LOCKS ) { }, total, done ) } int main( int argc, char * argv[] ) { BENCH_START() cluster clus; processor * proc[threads]; for ( i; threads ) // create procs (*(proc[i] = alloc())){clus}; worker * w[threads]; for ( i; threads ) // create threads (*(w[i] = alloc())){ clus }; sleep( 10`s ); done = true; for ( i; threads ) // delete threads delete(w[i]); for ( i; threads ) // delete procs delete(proc[i]); printf( "%lu\n", total ); } // Local Variables: // // tab-width: 4 // // End: //