Changeset 0b84b15 for benchmark/readyQ/cycle.cfa
- Timestamp:
- Oct 29, 2020, 3:33:45 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 93068e53
- Parents:
- b35ab2d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/readyQ/cycle.cfa
rb35ab2d r0b84b15 4 4 Partner * partner; 5 5 unsigned long long count; 6 bool first;7 6 }; 8 7 … … 12 11 13 12 void main( Partner & this ) { 14 thread_loop { 13 this.count = 0; 14 for() { 15 15 park(); 16 16 unpark( *this.partner ); 17 this.count ++; 18 if( clock_mode && stop) break; 19 if(!clock_mode && this.count >= stop_count) break; 17 20 } 18 21 19 22 __atomic_fetch_add(&threads_left, -1, __ATOMIC_SEQ_CST); 20 21 if(this.first) park();22 23 } 23 24 … … 41 42 unsigned pi = (i + nthreads) % tthreads; 42 43 threads[i].partner = &threads[pi]; 43 threads[i].first = i < nthreads;44 44 } 45 45 printf("Starting\n"); … … 51 51 unpark( threads[i] ); 52 52 } 53 wait(start, end,is_tty);53 wait(start, is_tty); 54 54 55 55 stop = true;
Note: See TracChangeset
for help on using the changeset viewer.