Changeset 5a46e09 for tests


Ignore:
Timestamp:
Jun 29, 2021, 5:33:38 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
660665f
Parents:
bae0d35
Message:

Added Martins SpinCondLock? as linear_backoff_then_block lock

Location:
tests/unified_locking
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/unified_locking/.expect/locks.txt

    rbae0d35 r5a46e09  
    1515Start Test 8: fast lock and condition variable 3 wait/notify all
    1616Done Test 8
    17 Start Test 9: multi acquisiton lock and condition variable multiple acquire and wait/notify
     17Start Test 9: linear backoff lock and condition variable single wait/notify
    1818Done Test 9
    19 Start Test 10: owner lock and condition variable multiple acquire and wait/notify
     19Start Test 10: linear backoff lock and condition variable 3 wait/notify all
    2020Done Test 10
    21 Start Test 11: no lock condition variable wait/notify
     21Start Test 11: multi acquisiton lock and condition variable multiple acquire and wait/notify
    2222Done Test 11
    23 Start Test 12: locked condition variable wait/notify with front()
     23Start Test 12: owner lock and condition variable multiple acquire and wait/notify
    2424Done Test 12
     25Start Test 13: no lock condition variable wait/notify
     26Done Test 13
     27Start Test 14: locked condition variable wait/notify with front()
     28Done Test 14
  • tests/unified_locking/locks.cfa

    rbae0d35 r5a46e09  
    1818condition_variable( fast_lock ) c_f;
    1919
     20linear_backoff_then_block_lock l;
     21condition_variable( linear_backoff_then_block_lock ) c_l;
     22
    2023thread T_C_M_WS1 {};
    2124
     
    99102                }
    100103                unlock(f);
     104        }
     105}
     106
     107thread T_C_L_WS1 {};
     108
     109void 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
     121thread T_C_L_WB1 {};
     122
     123void 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);
    101132        }
    102133}
     
    298329        printf("Done Test 8\n");
    299330
    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");
    301344        {
    302345                T_C_M_WS2 t1[2];
    303346        }
    304         printf("Done Test 9\n");
    305 
    306         printf("Start Test 10: 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");
    307350        {
    308351                T_C_O_WS2 t1[2];
    309352        }
    310         printf("Done Test 10\n");
    311 
    312         printf("Start Test 11: 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");
    313356        {
    314357                T_C_NLW t1;
    315358                T_C_NLS t2;
    316359        }
    317         printf("Done Test 11\n");
    318 
    319         printf("Start Test 12: 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");
    320363        {
    321364                T_C_S_WNF t1[2];
    322365        }
    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.