Changeset 10b5970 for tests/concurrency
- Timestamp:
- Jan 7, 2025, 3:22:19 PM (9 months ago)
- Branches:
- master
- Children:
- 190a833
- Parents:
- 70670e7
- Location:
- tests/concurrency
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/channels/ping_pong.cfa
r70670e7 r10b5970 16 16 17 17 thread Pong {}; 18 void main(Pong & this) {18 void main(Pong &) { 19 19 try { 20 20 for ( ;; ) { … … 27 27 28 28 thread Ping {}; 29 void main(Ping & this) {29 void main(Ping &) { 30 30 try { 31 31 for ( ;; ) { … … 39 39 40 40 41 int main( int argc, char * argv[]) {41 int main() { 42 42 sout | "start"; 43 43 processor proc[1]; -
tests/concurrency/cluster.cfa
r70670e7 r10b5970 9 9 } 10 10 11 void main( MyThread & this) {11 void main( MyThread & ) { 12 12 for(50) { 13 13 yield(); -
tests/concurrency/coroutineYield.cfa
r70670e7 r10b5970 24 24 coroutine Coroutine {}; 25 25 26 void main( Coroutine& this) {26 void main( Coroutine & ) { 27 27 while(true) { 28 28 #if !defined(TEST_FOREVER) … … 39 39 40 40 Coroutine c; 41 int main( int argc, char* argv[]) {41 int main() { 42 42 for(int i = 0; TEST(i < N); i++) { 43 43 #if !defined(TEST_FOREVER) -
tests/concurrency/examples/boundedBufferEXT.cfa
r70670e7 r10b5970 94 94 Buffer(int) buffer; 95 95 int sums[Cons]; 96 int i;97 96 processor p; 98 97 -
tests/concurrency/examples/boundedBufferINT.cfa
r70670e7 r10b5970 94 94 Consumer * cons[Cons]; 95 95 int sums[Cons]; 96 int i;97 96 processor p; 98 97 -
tests/concurrency/futures/wait_any.cfa
r70670e7 r10b5970 32 32 33 33 thread Waiter {}; 34 void main( Waiter & this) {34 void main( Waiter & ) { 35 35 for (numtimes) { 36 36 wait_any(futures, num_futures); … … 42 42 43 43 thread Deliverer {}; 44 void main( Deliverer & this) {44 void main( Deliverer & ) { 45 45 while (!done) { 46 46 size_t num_satisfy = random(1,num_futures); -
tests/concurrency/join.cfa
r70670e7 r10b5970 28 28 29 29 30 int main( int argc, char* argv[]) {30 int main() { 31 31 { 32 32 Worker workers[17]; -
tests/concurrency/migrate.cfa
r70670e7 r10b5970 47 47 } 48 48 49 struct cluster_wrapper * curr = (struct cluster_wrapper *)&the_clusters[0];50 51 49 for(100) { 52 50 unsigned idx = prng( this, cluster_cnt ); -
tests/concurrency/monitor.cfa
r70670e7 r10b5970 28 28 thread MyThread {}; 29 29 30 void main( MyThread & this) {30 void main( MyThread & ) { 31 31 for(int i = 0; i < 750_000; i++) { 32 32 increment( global ); … … 34 34 } 35 35 36 int main( int argc, char* argv[]) {36 int main() { 37 37 assert( global.__mon.entry_queue.tail != NULL ); 38 38 processor p; -
tests/concurrency/multi-monitor.cfa
r70670e7 r10b5970 44 44 } 45 45 46 int main( int argc, char* argv[]) {46 int main() { 47 47 processor p; 48 48 { -
tests/concurrency/mutexstmt/locks.cfa
r70670e7 r10b5970 12 12 int count = 0; 13 13 14 void main( T_Mutex & this) {14 void main( T_Mutex & ) { 15 15 for (unsigned int i = 0; i < num_times; i++) { 16 16 mutex ( m1 ) count++; … … 35 35 thread T_Multi {}; 36 36 37 void main( T_Multi & this) {37 void main( T_Multi & ) { 38 38 for (unsigned int i = 0; i < num_times; i++) { 39 39 refTest( m1 ); … … 81 81 thread T_Multi_Poly {}; 82 82 83 void main( T_Multi_Poly & this) {83 void main( T_Multi_Poly & ) { 84 84 for (unsigned int i = 0; i < num_times; i++) { 85 85 refTest( l1 ); -
tests/concurrency/mutexstmt/monitors.cfa
r70670e7 r10b5970 16 16 bool startFlag = false; 17 17 18 void main( T_Mutex & this) {18 void main( T_Mutex & ) { 19 19 for (unsigned int i = 0; i < num_times; i++) { 20 20 mutex ( m1 ) count++; … … 30 30 thread T_Multi {}; 31 31 32 void main( T_Multi & this) {32 void main( T_Multi & ) { 33 33 for (unsigned int i = 0; i < num_times; i++) { 34 34 mutex ( m1 ) { -
tests/concurrency/preempt.cfa
r70670e7 r10b5970 71 71 } 72 72 73 int main( int argc, char* argv[]) {73 int main() { 74 74 processor p; 75 75 globals.counter = 0; -
tests/concurrency/pthread/pthread_cond_test.cfa
r70670e7 r10b5970 9 9 pthread_cond_t cond; 10 10 11 extern "C" {12 void* S1( void* arg){11 extern "C" { 12 void* S1( void * ) { 13 13 pthread_mutex_lock(&_mutex); 14 14 for (int i = 0; i < 1000; i++) sout | "S1 done " | i; … … 19 19 } 20 20 21 void* S2( void* arg){21 void* S2( void * ) { 22 22 pthread_mutex_lock(&_mutex); 23 23 if (!done_flag) pthread_cond_wait(&cond, &_mutex); … … 30 30 31 31 32 int main(int argc, char const *argv[]) 33 { 34 /* code */ 32 int main() { 35 33 pthread_mutex_init(&_mutex, NULL); 36 34 pthread_cond_init(&cond, NULL); -
tests/concurrency/pthread/pthread_once_test.cfa
r70670e7 r10b5970 90 90 91 91 92 int main( int argc, char const *argv[])92 int main() 93 93 { 94 94 test(); -
tests/concurrency/readyQ/leader_spin.cfa
r70670e7 r10b5970 97 97 98 98 // ================================================== 99 int main( int argc, char * argv[]) {99 int main() { 100 100 lead_idx = 0; 101 101 leader = prng( lead_rng, nthreads ); -
tests/concurrency/signal/block.cfa
r70670e7 r10b5970 51 51 52 52 //------------------------------------------------------------------------------ 53 void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i) {53 void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned ) { 54 54 wait( cond, (uintptr_t)active_thread() ); 55 55 … … 67 67 68 68 thread Waiter {}; 69 void main( Waiter & this) {69 void main( Waiter & ) { 70 70 for( int i = 0; TEST(i < N); i++ ) { 71 71 wait_op( globalA, globalB, i ); … … 100 100 101 101 thread Signaller {}; 102 void main( Signaller & this) {102 void main( Signaller & ) { 103 103 while( !done ) { 104 104 signal_op( globalA, globalB ); … … 112 112 113 113 thread Barger {}; 114 void main( Barger & this) {114 void main( Barger & ) { 115 115 for( unsigned i = 0; !done; i++ ) { 116 116 //Choose some monitor to barge into with some irregular pattern … … 123 123 //------------------------------------------------------------------------------ 124 124 125 int main( int argc, char* argv[]) {125 int main() { 126 126 srandom( time( NULL ) ); 127 127 done = false; -
tests/concurrency/signal/disjoint.cfa
r70670e7 r10b5970 65 65 } 66 66 67 void main( Barger & this) {67 void main( Barger & ) { 68 68 while( !all_done ) { 69 69 barge( globals.data ); … … 93 93 } 94 94 95 void main( Waiter & this) {95 void main( Waiter & ) { 96 96 while( wait( globals.mut, globals.data ) ) { KICK_WATCHDOG; yield(); } 97 97 } … … 122 122 } 123 123 124 void main( Signaller & this) {124 void main( Signaller & ) { 125 125 while( !all_done ) { 126 126 logic( globals.mut ); … … 131 131 //------------------------------------------------------------------------------ 132 132 // Main loop 133 int main( int argc, char* argv[]) {133 int main() { 134 134 srandom( time( NULL ) ); 135 135 all_done = false; -
tests/concurrency/signal/wait.cfa
r70670e7 r10b5970 65 65 //---------------------------------------------------------------------------------------------------- 66 66 // Signaler 67 void main( Signaler & this) {67 void main( Signaler & ) { 68 68 69 69 while( waiter_left != 0 ) { … … 92 92 //---------------------------------------------------------------------------------------------------- 93 93 // Waiter ABC 94 void main( WaiterABC & this) {94 void main( WaiterABC & ) { 95 95 for( int i = 0; TEST(i < N); i++ ) { 96 96 wait( condABC, globalA, globalB, globalC ); … … 103 103 //---------------------------------------------------------------------------------------------------- 104 104 // Waiter AB 105 void main( WaiterAB & this) {105 void main( WaiterAB & ) { 106 106 for( int i = 0; TEST(i < N); i++ ) { 107 107 wait( condAB , globalA, globalB ); … … 114 114 //---------------------------------------------------------------------------------------------------- 115 115 // Waiter AC 116 void main( WaiterAC & this) {116 void main( WaiterAC & ) { 117 117 for( int i = 0; TEST(i < N); i++ ) { 118 118 wait( condAC , globalA, globalC ); … … 125 125 //---------------------------------------------------------------------------------------------------- 126 126 // Waiter BC 127 void main( WaiterBC & this) {127 void main( WaiterBC & ) { 128 128 for( int i = 0; TEST(i < N); i++ ) { 129 129 wait( condBC , globalB, globalC ); … … 136 136 //---------------------------------------------------------------------------------------------------- 137 137 // Main 138 int main( int argc, char* argv[]) {138 int main() { 139 139 srandom( time( NULL ) ); 140 140 waiter_left = 4; -
tests/concurrency/suspend_then.cfa
r70670e7 r10b5970 64 64 65 65 thread Thread {}; 66 void main( Thread & this) {66 void main( Thread & ) { 67 67 Coroutine * mine = 0p; 68 68 while(!done) { … … 78 78 79 79 80 int main( int argc, char* argv[]) {80 int main() { 81 81 processor p[2]; 82 82 Coroutine c; -
tests/concurrency/thread.cfa
r70670e7 r10b5970 28 28 29 29 30 int main( int argc, char* argv[]) {30 int main() { 31 31 semaphore lock = { 0 }; 32 32 sout | "User main begin"; -
tests/concurrency/unified_locking/locks.cfa
r70670e7 r10b5970 23 23 thread T_C_M_WS1 {}; 24 24 25 void main( T_C_M_WS1 & this) {25 void main( T_C_M_WS1 & ) { 26 26 for (unsigned int i = 0; i < num_times; i++) { 27 27 lock(m); … … 37 37 thread T_C_M_WB1 {}; 38 38 39 void main( T_C_M_WB1 & this) {39 void main( T_C_M_WB1 & ) { 40 40 for (unsigned int i = 0; i < num_times; i++) { 41 41 lock(m); … … 51 51 thread T_C_S_WS1 {}; 52 52 53 void main( T_C_S_WS1 & this) {53 void main( T_C_S_WS1 & ) { 54 54 for (unsigned int i = 0; i < num_times; i++) { 55 55 lock(s); … … 65 65 thread T_C_S_WB1 {}; 66 66 67 void main( T_C_S_WB1 & this) {67 void main( T_C_S_WB1 & ) { 68 68 for (unsigned int i = 0; i < num_times; i++) { 69 69 lock(s); … … 79 79 thread T_C_L_WS1 {}; 80 80 81 void main( T_C_L_WS1 & this) {81 void main( T_C_L_WS1 & ) { 82 82 for (unsigned int i = 0; i < num_times; i++) { 83 83 lock(l); … … 93 93 thread T_C_L_WB1 {}; 94 94 95 void main( T_C_L_WB1 & this) {95 void main( T_C_L_WB1 & ) { 96 96 for (unsigned int i = 0; i < num_times; i++) { 97 97 lock(l); … … 107 107 thread T_F_C_F_WS1 {}; 108 108 109 void main( T_F_C_F_WS1 & this) {109 void main( T_F_C_F_WS1 & ) { 110 110 for (unsigned int i = 0; i < num_times; i++) { 111 111 lock(f); … … 121 121 thread T_C_O_WS1 {}; 122 122 123 void main( T_C_O_WS1 & this) {123 void main( T_C_O_WS1 & ) { 124 124 for (unsigned int i = 0; i < num_times; i++) { 125 125 lock(o); … … 135 135 thread T_C_O_WB1 {}; 136 136 137 void main( T_C_O_WB1 & this) {137 void main( T_C_O_WB1 & ) { 138 138 for (unsigned int i = 0; i < num_times; i++) { 139 139 lock(o); … … 149 149 thread T_C_M_WS2 {}; 150 150 151 void main( T_C_M_WS2 & this) {151 void main( T_C_M_WS2 & ) { 152 152 for (unsigned int i = 0; i < num_times; i++) { 153 153 lock(m); … … 167 167 thread T_C_O_WS2 {}; 168 168 169 void main( T_C_O_WS2 & this) {169 void main( T_C_O_WS2 & ) { 170 170 for (unsigned int i = 0; i < num_times; i++) { 171 171 lock(o); … … 185 185 thread T_C_NLW {}; 186 186 187 void main( T_C_NLW & this) {187 void main( T_C_NLW & ) { 188 188 for (unsigned int i = 0; i < num_times; i++) { 189 189 wait(c_o); … … 193 193 thread T_C_NLS {}; 194 194 195 void main( T_C_NLS & this) {195 void main( T_C_NLS & ) { 196 196 for (unsigned int i = 0; i < num_times; i++) { 197 197 while (empty(c_o)) { } … … 202 202 thread T_C_S_WNF {}; 203 203 204 void main( T_C_S_WNF & this) {204 void main( T_C_S_WNF & ) { 205 205 for (unsigned int i = 0; i < num_times; i++) { 206 206 lock(s); … … 219 219 thread T_C_NLWD {}; 220 220 221 void main( T_C_NLWD & this) {221 void main( T_C_NLWD & ) { 222 222 done = false; 223 223 for (unsigned int i = 0; i < num_times/5; i++) { … … 230 230 thread T_C_WDS {}; 231 231 232 void main( T_C_WDS & this) {232 void main( T_C_WDS & ) { 233 233 for (unsigned int i = 0; i < num_times; i++) { 234 234 while (empty(c_s) && !done) { } … … 241 241 thread T_C_LWD {}; 242 242 243 void main( T_C_LWD & this) {243 void main( T_C_LWD & ) { 244 244 done = false; 245 245 for (unsigned int i = 0; i < num_times/5; i++) { … … 254 254 thread T_C_LWDS {}; 255 255 256 void main( T_C_LWDS & this) {256 void main( T_C_LWDS & ) { 257 257 for (unsigned int i = 0; i < num_times; i++) { 258 258 while (empty(c_s) && !done) { } -
tests/concurrency/unified_locking/pthread_locks.cfa
r70670e7 r10b5970 18 18 thread Wait_Signal_1 {}; 19 19 20 void main( Wait_Signal_1 & this) {20 void main( Wait_Signal_1 & ) { 21 21 for (unsigned int i = 0; i < num_times; i++) { 22 22 lock(l); … … 32 32 thread Wait_3_Signal_3 {}; 33 33 34 void main( Wait_3_Signal_3 & this) {34 void main( Wait_3_Signal_3 & ) { 35 35 for (unsigned int i = 0; i < num_times; i++) { 36 36 lock(l); … … 48 48 thread Rec_Lock_Wait_Signal_1 {}; 49 49 50 void main( Rec_Lock_Wait_Signal_1 & this) {50 void main( Rec_Lock_Wait_Signal_1 & ) { 51 51 for (unsigned int i = 0; i < num_times; i++) { 52 52 lock(l); … … 66 66 thread Wait_Time_Signal_1 {}; 67 67 68 void main( Wait_Time_Signal_1 & this) {68 void main( Wait_Time_Signal_1 & ) { 69 69 for (unsigned int i = 0; i < num_times; i++) { 70 70 lock(l); … … 74 74 timespec waitTime{0,1}; 75 75 bool woken = wait(c,l, t + waitTime); 76 (void) woken; 76 77 }else{ 77 78 notify_one(c); -
tests/concurrency/waitfor/barge.cfa
r70670e7 r10b5970 30 30 } 31 31 32 void ^?{} ( global_t & mutex this) {}32 void ^?{} ( global_t & mutex ) {} 33 33 34 34 global_t global; … … 40 40 41 41 thread barger_t {}; 42 void main( barger_t & this) {42 void main( barger_t & ) { 43 43 yield(); 44 44 while( barge( global ) ) { yield(random( 10 )); } … … 56 56 57 57 thread caller_t {}; 58 void main( caller_t & this) {58 void main( caller_t & ) { 59 59 while( do_call(global) ) { yield(random( 10 )); } 60 60 } … … 78 78 79 79 thread waiter_t{}; 80 void main( waiter_t & this) {80 void main( waiter_t & ) { 81 81 do_wait(global); 82 82 } -
tests/concurrency/waitfor/statment.cfa
r70670e7 r10b5970 89 89 } 90 90 91 void main( caller & this) {91 void main( caller & ) { 92 92 int index = get_index( m ); 93 93 while( !start ) yield(); … … 122 122 thread waiter{}; 123 123 124 void main( waiter & this) {124 void main( waiter & ) { 125 125 do_wait( m ); 126 126 } -
tests/concurrency/waitfor/when.cfa
r70670e7 r10b5970 39 39 40 40 thread caller_t{}; 41 void main( caller_t & this) {41 void main( caller_t & ) { 42 42 while( true ) { 43 43 rand_yield(); … … 76 76 77 77 thread arbiter_t{}; 78 void main( arbiter_t & this) {78 void main( arbiter_t & ) { 79 79 arbiter( global ); 80 80 } -
tests/concurrency/waituntil/channel_zero_size.cfa
r70670e7 r10b5970 9 9 10 10 thread Server1 {}; 11 void main( Server1 & this) {11 void main( Server1 & ) { 12 12 long long int a, b, c, i = 0, myTotal = 0; 13 13 for( ;;i++ ) { -
tests/concurrency/waituntil/one_chan.cfa
r70670e7 r10b5970 9 9 10 10 thread Server1 {}; 11 void main( Server1 & this) {11 void main( Server1 & ) { 12 12 long long int c, i = 0, myTotal = 0; 13 13 for( ;;i++ ) {
Note:
See TracChangeset
for help on using the changeset viewer.