Ignore:
Timestamp:
Feb 18, 2025, 12:54:23 PM (8 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
8705a11
Parents:
3e5fea2
Message:

Clean-up the warnings of the concurrency tests. A lot of little test level fixes, the most interesting repeated one is some formally redundent fallthough statements. pthread_attr_test had to be rewritten because of library restrictions. Changed some types so they would always be pointer sized. There was a library change, there was a function that could not be implemented; I trust that it is included for a reason so I just put it in a comment. There is a change to the compiler, wait-until now uses goto. The labelled breaks were code generated as unlabelled breaks and although it worked out slipped through some checks. Finally, there is one warning that I cannot solve at this time so tests that produce it have been put in their own lax group.

Location:
tests/concurrency/waituntil
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrency/waituntil/all_types.cfa

    r3e5fea2 rd923fca  
    3333
    3434thread Server1 {};
    35 void main( Server1 & this ) {
    36     long long int a, b, c, i = 0, myTotal = 0;
     35void main( Server1 & ) {
     36    long long int a, c, i = 0, myTotal = 0;
    3737    for( ;;i++ ) {
    3838        when( i % 2 == 0 ) waituntil( a << A ) { myTotal += a; }
     
    4646
    4747thread Drainer {}; // ensures that the changing when states of Server1 don't result in a deadlock
    48 void main( Drainer & this ) {
    49     long long int a, b, c, myTotal = 0;
     48void main( Drainer & ) {
     49    long long int a, c, myTotal = 0;
    5050    for( ;; ) {
    5151        waituntil( F ) { myTotal += get(F); reset( F ); }
     
    5959
    6060thread Churner {}; // performs non-waituntil try insert/remove operations to add churn/interference
    61 void main( Churner & this ) {
     61void main( Churner & ) {
    6262    long long int out, myTotal = 0;
    6363    bool success;
  • tests/concurrency/waituntil/channel_close.cfa

    r3e5fea2 rd923fca  
    99
    1010thread Producer {};
    11 void main( Producer & this ) {
     11void main( Producer & ) {
    1212    try {
    1313        for( size_t i; 0~@ ) {
     
    1515            and waituntil( B << i ) { inserts++; }
    1616        }
    17     } catch ( channel_closed * e ) {} 
     17    } catch ( channel_closed * e ) {}
    1818}
    1919
    2020bool useAnd = false;
    2121thread Consumer {}; // ensures that the changing when states of Server1 don't result in a deadlock
    22 void main( Consumer & this ) {
     22void main( Consumer & ) {
    2323    ssize_t in, in2, A_removes = 0, B_removes = 0;
    2424
     
    3434        }
    3535    } catchResume ( channel_closed * e ) {                              // continue to remove until would block
    36         } catch ( channel_closed * e ) {} 
     36        } catch ( channel_closed * e ) {}
    3737
    3838    try {
     
    4040            waituntil( (in << A) ) { __atomic_thread_fence( __ATOMIC_SEQ_CST ); assert( A_removes == in ); A_removes++; removes++; }
    4141    } catchResume ( channel_closed * e ) {                              // continue to remove until would block
    42         } catch ( channel_closed * e ) {} 
     42        } catch ( channel_closed * e ) {}
    4343
    4444    try {
     
    4646            waituntil( (in << B) ) { __atomic_thread_fence( __ATOMIC_SEQ_CST ); assert( B_removes == in ); B_removes++; removes++; }
    4747    } catchResume ( channel_closed * e ) {                              // continue to remove until would block
    48         } catch ( channel_closed * e ) {} 
     48        } catch ( channel_closed * e ) {}
    4949}
    5050
  • tests/concurrency/waituntil/channels.cfa

    r3e5fea2 rd923fca  
    99
    1010thread Server1 {};
    11 void main( Server1 & this ) {
     11void main( Server1 & ) {
    1212    long long int a, b, c, i = 0, myTotal = 0;
    1313    for( ;;i++ ) {
     
    2121
    2222thread Drainer {}; // ensures that the changing when states of Server1 don't result in a deadlock
    23 void main( Drainer & this ) {
     23void main( Drainer & ) {
    2424    long long int a, b, c, myTotal = 0;
    2525    for( ;; ) {
     
    3333
    3434thread Churner {}; // performs non-waituntil try insert/remove operations to add churn/interference
    35 void main( Churner & this ) {
     35void main( Churner & ) {
    3636    long long int out, myTotal = 0;
    3737    bool success;
  • tests/concurrency/waituntil/futures.cfa

    r3e5fea2 rd923fca  
    88
    99thread Server1 {};
    10 void main( Server1 & this ) {
     10void main( Server1 & ) {
    1111    fulfil(B, 3);
    1212    P( s );
     
    1616
    1717thread Server2 {};
    18 void main( Server2 & this ) {
     18void main( Server2 & ) {
    1919    fulfil(B, 6);
    2020    fulfil(A, 5);
  • tests/concurrency/waituntil/locks.cfa

    r3e5fea2 rd923fca  
    1212
    1313thread Server1 {};
    14 void main( Server1 & this ) {
     14void main( Server1 & ) {
    1515    while( !done ) {
    1616        lock(A);
     
    4444                )
    4545                and when( i < 4 ) waituntil( C ) { c++; }
    46                
     46
    4747                when( i % 2 == 0 ) waituntil( A ) { a++; }
    4848                and when( i % 4 < 2 ) waituntil( B ) { b++; }
  • tests/concurrency/waituntil/repeat_close.cfa

    r3e5fea2 rd923fca  
    1010
    1111thread Producer {};
    12 void main( Producer & this ) {
    13     long long int my_inserts = 0;
     12void main( Producer & ) {
    1413    long long int A_i = 0, B_i = 0, C_i = 0, D_i = 0, E_i = 0, F_i = 0;
    1514    try {
     
    2221            and waituntil( F << i ) { F_i++; }
    2322        }
    24     } catch ( channel_closed * e ) {} 
     23    } catch ( channel_closed * e ) {}
    2524    __atomic_fetch_add( &inserts, A_i + B_i + C_i + D_i + E_i + F_i, __ATOMIC_SEQ_CST );
    2625}
    2726
    2827thread Consumer {};
    29 void main( Consumer & this ) {
     28void main( Consumer & ) {
    3029    long long int in, A_removes = 0, B_removes = 0, C_removes = 0, D_removes = 0, E_removes = 0, F_removes = 0;
    3130    try {
     
    8382    printf("Start\n");
    8483    for ( i; num_times ) {
    85         printf("%lu\n", i);
     84        printf("%zu\n", i);
    8685        A{chan_size};
    8786        B{chan_size};
Note: See TracChangeset for help on using the changeset viewer.