Changeset 7bd23ce
- Timestamp:
- May 27, 2021, 2:39:35 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- cece53c
- Parents:
- ab388c5
- Location:
- tests/concurrent
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tests/concurrent/.expect/sleep.txt ¶
rab388c5 r7bd23ce 1 1 start 2 fast loop 0.0473 fast loop 0.0944 fast loop 0.1415 fast loop 0.1886 fast loop 0.2357 slow loop 0.2778 fast loop 0.2829 fast loop 0.32910 fast loop 0.37611 fast loop 0.42312 fast loop 0.4713 fast loop 0.51714 slow loop 0.55415 fast loop 0.56416 fast loop 0.61117 fast loop 0.65818 fast loop 0.70519 fast loop 0.75220 fast loop 0.79921 slow loop 0.83122 fast loop 0.84623 fast loop 0.89324 fast loop 0.9425 slow loop 1.10826 2 done -
TabularUnified tests/concurrent/sleep.cfa ¶
rab388c5 r7bd23ce 7 7 } 8 8 9 volatile int counter = 0; 10 9 11 thread fast_sleeper {}; 10 12 void main(fast_sleeper &) { … … 12 14 for(i; 20) { 13 15 sleep(wait); 14 sout | acquire | "fast loop" | ((1 + i) * wait);16 __atomic_fetch_add( &counter, 1, __ATOMIC_RELAXED ); 15 17 } 16 18 } … … 20 22 Duration wait = 277`ms; 21 23 for(i; 4) { 22 23 24 sleep(wait); 24 sout | acquire | "slow loop" | ((1 + i) * wait); 25 int val = __atomic_add_fetch( &counter, -5, __ATOMIC_RELAXED ); 26 if(val < -9) abort | "Value reached negative value:" | val; 25 27 } 26 28 }
Note: See TracChangeset
for help on using the changeset viewer.