Changeset 6a6e205
- Timestamp:
- Jan 13, 2025, 1:32:32 PM (7 days ago)
- Branches:
- master
- Children:
- c086c6e
- Parents:
- 267b543
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/actor.hfa
r267b543 r6a6e205 113 113 return buffer[old_idx]; 114 114 } 115 request * ret = 0p;116 115 return *0p; 117 116 } … … 147 146 id = i; 148 147 missed = 0; 148 #else 149 (void) i; 149 150 #endif 150 151 } … … 715 716 struct finished_msg_t { inline message; } finished_msg = __base_msg_finished; 716 717 717 allocation receive( actor & this, delete_msg_t & ) { return Delete; }718 allocation receive( actor & this, destroy_msg_t & ) { return Destroy; }719 allocation receive( actor & this, finished_msg_t & ) { return Finished; }718 allocation receive( actor &, delete_msg_t & ) { return Delete; } 719 allocation receive( actor &, destroy_msg_t & ) { return Destroy; } 720 allocation receive( actor &, finished_msg_t & ) { return Finished; } 720 721 721 722 // Default messages used all the time. -
tests/Makefile.am
r267b543 r6a6e205 62 62 WFLGAS_OPT_LAX_TO_INVESTIGATE = \ 63 63 attributes \ 64 collections/atomic_mpsc \65 64 collections/queue \ 66 65 collections/sequence \ … … 90 89 concurrency/pthread/pthread_demo_lock \ 91 90 concurrency/pthread/pthread_key_test \ 92 concurrency/pthread/pthread_once_test \93 concurrency/unified_locking/block_spin_lock \94 concurrency/unified_locking/exp_backoff \95 concurrency/unified_locking/fast_block_lock \96 concurrency/unified_locking/futex_mutex \97 concurrency/unified_locking/locks \98 concurrency/unified_locking/mcs \99 concurrency/unified_locking/mcs_block_spin_lock \100 concurrency/unified_locking/mcs_spin \101 concurrency/unified_locking/pthread_locks \102 concurrency/unified_locking/simple_owner_lock \103 concurrency/unified_locking/spin_queue_lock \104 concurrency/unified_locking/timeout_lock \105 91 concurrency/waituntil/all_types \ 106 92 concurrency/waituntil/basic_else \ -
tests/collections/atomic_mpsc.cfa
r267b543 r6a6e205 33 33 void wait(Producer & this) { 34 34 some_node node; 35 node.value = (u nsigned)&this;35 node.value = (uintptr_t)&this; 36 36 push(global_queue, &node); 37 37 wait(node.sem); -
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.