Changeset cd477ca
- Timestamp:
- Mar 19, 2023, 1:52:19 PM (20 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- eac318a
- Parents:
- 5f648fb3
- Location:
- doc/theses/colby_parsons_MMAth/benchmarks/mutex_stmt
- Files:
-
- 2 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/benchmarks/mutex_stmt/cfa/order.cfa
r5f648fb3 rcd477ca 10 10 uint64_t total = 0; 11 11 thread worker {}; 12 static inline void ?{}( worker & this, cluster & clu ) { 13 ((thread &)this){ clu }; 14 } 12 15 void main( worker & w ) { 13 16 BENCH( mutex ( LOCKS ) { }, total, done ) … … 16 19 int main( int argc, char * argv[] ) { 17 20 BENCH_START() 18 processor p[threads]; // one extra for main thread 19 { 20 worker w[threads]; 21 sleep( 10`s ); 22 done = true; 23 } 21 cluster clus; 22 processor * proc[threads]; 23 for ( i; threads ) // create procs 24 (*(proc[i] = alloc())){clus}; 25 26 worker * w[threads]; 27 for ( i; threads ) // create threads 28 (*(w[i] = alloc())){ clus }; 29 30 sleep( 10`s ); 31 done = true; 32 33 for ( i; threads ) // delete threads 34 delete(w[i]); 35 36 for ( i; threads ) // delete procs 37 delete(proc[i]); 24 38 printf( "%lu\n", total ); 25 39 }
Note: See TracChangeset
for help on using the changeset viewer.