Changeset 6a6e205 for tests/concurrency
- Timestamp:
- Jan 13, 2025, 1:32:32 PM (7 days ago)
- Branches:
- master
- Children:
- c086c6e
- Parents:
- 267b543
- Location:
- tests/concurrency
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/actors/dynamic.cfa
r267b543 r6a6e205 19 19 void ?{}( derived_msg & this ) { ((derived_msg &)this){ 0 }; } 20 20 21 allocation receive( derived_actor & receiver, derived_msg & msg ) {21 allocation receive( derived_actor &, derived_msg & msg ) { 22 22 if ( msg.cnt >= Times ) { 23 23 sout | "Done"; -
tests/concurrency/actors/inherit.cfa
r267b543 r6a6e205 21 21 } 22 22 23 allocation receive( Server & receiver, D_msg & msg) { return handle(); }24 allocation receive( Server & receiver, D_msg2 & msg) { return handle(); }25 allocation receive( Server2 & receiver, D_msg & msg) { return Delete; }26 allocation receive( Server2 & receiver, D_msg2 & msg) { return Delete; }23 allocation receive( Server &, D_msg & ) { return handle(); } 24 allocation receive( Server &, D_msg2 & ) { return handle(); } 25 allocation receive( Server2 &, D_msg & ) { return Delete; } 26 allocation receive( Server2 &, D_msg2 & ) { return Delete; } 27 27 28 28 int main() { -
tests/concurrency/actors/inline.cfa
r267b543 r6a6e205 50 50 d_msg2 dm{ 29079 }; 51 51 set_allocation( dm, Nodelete ); 52 msg_wrapper * mw = &dm; 53 message * mg = &dm; 54 virtual_dtor * v = &dm; 52 msg_wrapper * mw = &dm; (void) mw; 53 message * mg = &dm; (void) mg; 54 virtual_dtor * v = &dm; (void) v; 55 55 da | dm; 56 56 actor_stop(); // waits until actors finish -
tests/concurrency/actors/pingpong.cfa
r267b543 r6a6e205 20 20 size_t times = 100000; 21 21 22 allocation receive( ping & receiver, p_msg & msg ) {22 allocation receive( ping &, p_msg & msg ) { 23 23 msg.count++; 24 24 if ( msg.count > times ) return Finished; … … 30 30 } 31 31 32 allocation receive( pong & receiver, p_msg & msg ) {32 allocation receive( pong &, p_msg & msg ) { 33 33 msg.count++; 34 34 if ( msg.count > times ) return Finished; … … 42 42 size_t Processors = 2; 43 43 44 int main( int argc, char * argv[]) {44 int main() { 45 45 sout | "start"; 46 46 -
tests/concurrency/actors/types.cfa
r267b543 r6a6e205 36 36 }; 37 37 38 allocation receive( derived_actor2 & receiver, d_msg & msg ) {38 allocation receive( derived_actor2 &, d_msg & msg ) { 39 39 mutex(sout) sout | msg.num; 40 40 return Finished; … … 48 48 }; 49 49 50 allocation receive( derived_actor3 & receiver, d_msg & msg ) {50 allocation receive( derived_actor3 &, d_msg & msg ) { 51 51 mutex(sout) sout | msg.num; 52 52 if ( msg.num == -1 ) return Nodelete; … … 54 54 } 55 55 56 allocation receive( derived_actor3 & receiver, d_msg2 & msg ) {56 allocation receive( derived_actor3 &, d_msg2 & msg ) { 57 57 mutex(sout) sout | msg.num; 58 58 return Finished; … … 61 61 size_t Processors = 3; 62 62 63 int main( int argc, char * argv[]) {63 int main() { 64 64 sout | "start"; 65 65 -
tests/concurrency/pthread/bounded_buffer.cfa
r267b543 r6a6e205 126 126 exit( EXIT_FAILURE ); 127 127 } // if 128 if ( (uint64_t)result != 0) {128 if ( result != 0p ) { 129 129 sout | "producers" | prods[i] |" bad return value " | result; 130 130 exit( EXIT_FAILURE ); … … 142 142 exit( EXIT_FAILURE ); 143 143 } // if 144 if ( (uint64_t)result != 0) {144 if ( result != 0p ) { 145 145 sout| "consumers bad return value" | result; 146 146 exit( EXIT_FAILURE ); -
tests/concurrency/pthread/pthread_demo_lock.cfa
r267b543 r6a6e205 15 15 // unlocked increnment 16 16 void* inc_unlock(void* cnt){ 17 for ( int i = 0; i < (uint64_t)cnt; i++){17 for (uintptr_t i = 0; i < (uintptr_t)cnt; i++){ 18 18 cnt_nolock++; 19 19 } // for … … 23 23 void* inc_lock(void* cnt){ 24 24 pthread_mutex_lock(&_mutex); 25 for ( int i = 0; i < (uint64_t)cnt; i++){25 for (uintptr_t i = 0; i < (uintptr_t)cnt; i++){ 26 26 cnt_lock++; 27 27 } // for … … 73 73 sout | "in trylocktest2 res2 is" | res; 74 74 pthread_mutex_lock(&_mutex); 75 for ( int i = 0; i < (uint64_t)arg; i++) cnt_trylock++;75 for (uintptr_t i = 0; i < (uintptr_t)arg; i++) cnt_trylock++; 76 76 pthread_mutex_unlock(&_mutex); 77 77 return NULL; … … 87 87 88 88 // inc cnt then release the lock 89 for ( int i = 0; i < (uint64_t)arg; i++) cnt_trylock++;89 for (uintptr_t i = 0; i < (uintptr_t)arg; i++) cnt_trylock++; 90 90 pthread_mutex_unlock(&_mutex); 91 91 pthread_mutex_unlock(&_mutex); … … 113 113 114 114 115 int main( int argc, char const *argv[])115 int main() 116 116 { 117 117 -
tests/concurrency/pthread/pthread_once_test.cfa
r267b543 r6a6e205 74 74 75 75 if (thread_stat[i] != 0) 76 printf("bad thread status, thread %d, status=% d\n", i+1,77 ( int)thread_stat[i]);76 printf("bad thread status, thread %d, status=%zu\n", i+1, 77 (size_t)thread_stat[i]); 78 78 } 79 79 -
tests/concurrency/unified_locking/mcs.cfa
r267b543 r6a6e205 22 22 unsigned cs() { 23 23 thread$ * me = active_thread(); 24 unsigned value = (u nsigned)me;24 unsigned value = (uintptr_t)me; 25 25 mcs_node n; 26 26 lock(mo.l, n); -
tests/concurrency/unified_locking/mcs_spin.cfa
r267b543 r6a6e205 32 32 mo.id = me; 33 33 yield(random(5)); 34 value = ((uint32_t)random()) ^ ((uint32_t) me);34 value = ((uint32_t)random()) ^ ((uint32_t)(uintptr_t)me); 35 35 if(mo.id != me) sout | "Intruder!"; 36 36 mo.cnt = cnt + 1; -
tests/concurrency/unified_locking/mutex_test.hfa
r267b543 r6a6e205 32 32 mo.id = me; 33 33 yield(random(5)); 34 value = ((uint32_t)random()) ^ ((uint32_t) me);34 value = ((uint32_t)random()) ^ ((uint32_t)(uintptr_t)me); 35 35 if(mo.id != me) sout | "Intruder!"; 36 36 mo.cnt = cnt + 1; -
tests/concurrency/unified_locking/timeout_lock.cfa
r267b543 r6a6e205 23 23 thread T1 {}; 24 24 25 void main( T1 & this) {25 void main( T1 & ) { 26 26 lock(m); 27 27 wait( c_m, m, 1`s ); … … 46 46 thread T2 {}; 47 47 48 void main( T2 & this) {48 void main( T2 & ) { 49 49 block(); 50 50
Note: See TracChangeset
for help on using the changeset viewer.