Changeset 5a46e09 for tests/unified_locking/locks.cfa
- Timestamp:
- Jun 29, 2021, 5:33:38 PM (2 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 660665f
- Parents:
- bae0d35
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/unified_locking/locks.cfa
rbae0d35 r5a46e09 18 18 condition_variable( fast_lock ) c_f; 19 19 20 linear_backoff_then_block_lock l; 21 condition_variable( linear_backoff_then_block_lock ) c_l; 22 20 23 thread T_C_M_WS1 {}; 21 24 … … 99 102 } 100 103 unlock(f); 104 } 105 } 106 107 thread T_C_L_WS1 {}; 108 109 void main( T_C_L_WS1 & this ) { 110 for (unsigned int i = 0; i < num_times; i++) { 111 lock(l); 112 if(empty(c_l) && i != num_times - 1) { 113 wait(c_l,l); 114 }else{ 115 notify_one(c_l); 116 } 117 unlock(l); 118 } 119 } 120 121 thread T_C_L_WB1 {}; 122 123 void main( T_C_L_WB1 & this ) { 124 for (unsigned int i = 0; i < num_times; i++) { 125 lock(l); 126 if(counter(c_l) == 3 || i == num_times - 1) { 127 notify_all(c_l); 128 }else{ 129 wait(c_l,l); 130 } 131 unlock(l); 101 132 } 102 133 } … … 298 329 printf("Done Test 8\n"); 299 330 300 printf("Start Test 9: multi acquisiton lock and condition variable multiple acquire and wait/notify\n"); 331 printf("Start Test 9: linear backoff lock and condition variable single wait/notify\n"); 332 { 333 T_C_L_WS1 t1[2]; 334 } 335 printf("Done Test 9\n"); 336 337 printf("Start Test 10: linear backoff lock and condition variable 3 wait/notify all\n"); 338 { 339 T_C_L_WB1 t1[4]; 340 } 341 printf("Done Test 10\n"); 342 343 printf("Start Test 11: multi acquisiton lock and condition variable multiple acquire and wait/notify\n"); 301 344 { 302 345 T_C_M_WS2 t1[2]; 303 346 } 304 printf("Done Test 9\n");305 306 printf("Start Test 1 0: owner lock and condition variable multiple acquire and wait/notify\n");347 printf("Done Test 11\n"); 348 349 printf("Start Test 12: owner lock and condition variable multiple acquire and wait/notify\n"); 307 350 { 308 351 T_C_O_WS2 t1[2]; 309 352 } 310 printf("Done Test 1 0\n");311 312 printf("Start Test 1 1: no lock condition variable wait/notify\n");353 printf("Done Test 12\n"); 354 355 printf("Start Test 13: no lock condition variable wait/notify\n"); 313 356 { 314 357 T_C_NLW t1; 315 358 T_C_NLS t2; 316 359 } 317 printf("Done Test 1 1\n");318 319 printf("Start Test 1 2: locked condition variable wait/notify with front()\n");360 printf("Done Test 13\n"); 361 362 printf("Start Test 14: locked condition variable wait/notify with front()\n"); 320 363 { 321 364 T_C_S_WNF t1[2]; 322 365 } 323 printf("Done Test 12\n"); 324 325 // removed to limit test duration. Full test is in long run tests 326 // printf("Start Test 11: unlocked condition variable delay wait\n"); 327 // { 328 // T_C_NLWD t1; 329 // T_C_WDS t2; 330 // } 331 // printf("Done Test 11\n"); 332 333 // printf("Start Test 12: locked condition variable delay wait with unlocked signal\n"); 334 // { 335 // T_C_LWD t1; 336 // T_C_WDS t2; 337 // } 338 // printf("Done Test 12\n"); 339 340 // printf("Start Test 13: locked condition variable delay wait with locked signal\n"); 341 // { 342 // T_C_LWD t1; 343 // T_C_LWDS t2; 344 // } 345 // printf("Done Test 13\n"); 346 } 366 printf("Done Test 14\n"); 367 }
Note: See TracChangeset
for help on using the changeset viewer.