Changeset 2a301ff for tests/concurrency
- Timestamp:
- Aug 31, 2023, 11:31:15 PM (3 years ago)
- Branches:
- master, stuck-waitfor-destruct
- Children:
- 950c58e
- Parents:
- 92355883 (diff), 686912c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- tests/concurrency
- Files:
-
- 4 added
- 9 edited
-
actors/inherit.cfa (modified) (1 diff)
-
channels/daisy_chain.cfa (modified) (2 diffs)
-
mutexstmt/.expect/tuple.txt (added)
-
mutexstmt/tuple.cfa (added)
-
unified_locking/thread_test.cfa (modified) (1 diff)
-
waituntil/.expect/repeat_close.txt (added)
-
waituntil/all_types.cfa (modified) (1 diff)
-
waituntil/channel_close.cfa (modified) (3 diffs)
-
waituntil/channel_zero_size.cfa (modified) (1 diff)
-
waituntil/channels.cfa (modified) (1 diff)
-
waituntil/one_chan.cfa (modified) (1 diff)
-
waituntil/repeat_close.cfa (added)
-
waituntil/timeout.cfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/actors/inherit.cfa
r92355883 r2a301ff 13 13 struct D_msg { int a; inline message; }; 14 14 void ?{}( D_msg & this ) { set_allocation( this, Delete ); } 15 void ^?{}( D_msg & this) { mutex(sout) sout | 'A'; }15 void ^?{}( D_msg & ) { mutex(sout) sout | 'A'; } 16 16 17 17 struct D_msg2 { inline D_msg; }; -
tests/concurrency/channels/daisy_chain.cfa
r92355883 r2a301ff 19 19 void main(Task & this) { 20 20 size_t runs = 0; 21 int token = 0; 21 22 try{ 22 23 for ( ;; ) { 23 remove( *chain );24 insert( *chain, 0 );24 token << *chain; 25 *chain << token; 25 26 runs++; 26 27 } … … 59 60 Channel chainChan{ 1 }; 60 61 61 insert( chainChan, 0);62 chainChan << ((int)0); 62 63 63 64 chain = &chainChan; -
tests/concurrency/unified_locking/thread_test.cfa
r92355883 r2a301ff 3 3 #include <stdlib.hfa> 4 4 #include <thread.hfa> 5 #include <co ntainers/array.hfa>5 #include <collections/array.hfa> 6 6 7 7 static unsigned int taskCount = 4; -
tests/concurrency/waituntil/all_types.cfa
r92355883 r2a301ff 96 96 Churner c; 97 97 for( long long int j = 0; j < numtimes; j++ ) { 98 when( j % 2 == 0 ) waituntil( j >> A) { total += j; }98 when( j % 2 == 0 ) waituntil( A << j ) { total += j; } 99 99 or when( j % 4 < 2 ) waituntil( B ) { produce_b_val( total ); } 100 and when( j % 8 < 4 ) waituntil( j >> C) { total += j; }100 and when( j % 8 < 4 ) waituntil( C << j ) { total += j; } 101 101 and waituntil( timeout( 1`ns ) ) {} 102 102 if ( j == numtimes / 2 ) -
tests/concurrency/waituntil/channel_close.cfa
r92355883 r2a301ff 13 13 try { 14 14 for( long long int i = 0;;i++ ) { 15 waituntil( (i >> A)) { inserts++; }16 and waituntil( (i >> B)) { inserts++; }15 waituntil( A << i ) { inserts++; } 16 and waituntil( B << i ) { inserts++; } 17 17 } 18 18 } catch ( channel_closed * e ) {} … … 31 31 } 32 32 waituntil( (in << A) ) { assert( A_removes == in ); A_removes++; removes++; } 33 or waituntil( (in 2 << B) ) { assert( B_removes == in2); B_removes++; removes++; }33 or waituntil( (in << B) ) { assert( B_removes == in ); B_removes++; removes++; } 34 34 } 35 35 } catchResume ( channel_closed * e ) {} // continue to remove until would block … … 74 74 ^B{}; 75 75 76 useAnd = true; 77 76 78 inserts = 0; 77 79 removes = 0; -
tests/concurrency/waituntil/channel_zero_size.cfa
r92355883 r2a301ff 37 37 for( long long int j = 0; j < numtimes; j++ ) { 38 38 // printf("loop\n"); 39 waituntil( j >> A) { total += j; }40 or waituntil( j >> B) { total += j; }41 or waituntil( j >> C) { total += j; }39 waituntil( A << j ) { total += j; } 40 or waituntil( B << j ) { total += j; } 41 or waituntil( C << j ) { total += j; } 42 42 } 43 43 printf("sending sentinels\n"); -
tests/concurrency/waituntil/channels.cfa
r92355883 r2a301ff 69 69 Churner c; 70 70 for( long long int j = 0; j < numtimes; j++ ) { 71 when( j % 2 == 0 ) waituntil( j >> A) { total += j; }72 or when( j % 4 < 2 ) waituntil( j >> B) { total += j; }73 and when( j % 8 < 4 ) waituntil( j >> C) { total += j; }71 when( j % 2 == 0 ) waituntil( A << j ) { total += j; } 72 or when( j % 4 < 2 ) waituntil( B << j ) { total += j; } 73 and when( j % 8 < 4 ) waituntil( C << j ) { total += j; } 74 74 } 75 75 done = true; -
tests/concurrency/waituntil/one_chan.cfa
r92355883 r2a301ff 31 31 Server1 s[numServers]; 32 32 for( long long int j = 0; j < numtimes; j++ ) { 33 waituntil( j >> C) { total += j; }33 waituntil( C << j ) { total += j; } 34 34 } 35 35 printf("waiting for empty channels\n"); -
tests/concurrency/waituntil/timeout.cfa
r92355883 r2a301ff 15 15 16 16 assert( count == 1000 ); 17 sleep( 1`ms ); 17 18 printf("done\n"); 18 19 }
Note:
See TracChangeset
for help on using the changeset viewer.