- Timestamp:
- Jun 4, 2023, 8:39:25 AM (19 months ago)
- Branches:
- ast-experimental, master
- Children:
- 84334d0
- Parents:
- 0794365
- Location:
- tests/concurrency/actors
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/actors/dynamic.cfa
r0794365 rc880a7b 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 & receiver, derived_msg & msg ) { 22 22 if ( msg.cnt >= Times ) { 23 23 sout | "Done"; -
tests/concurrency/actors/executor.cfa
r0794365 rc880a7b 24 24 struct d_msg { inline message; } shared_msg; 25 25 26 Allocation receive( d_actor & this, d_msg & msg ) with( this ) {26 allocation receive( d_actor & this, d_msg & msg ) with( this ) { 27 27 if ( recs == rounds ) return Finished; 28 28 if ( recs % Batch == 0 ) { -
tests/concurrency/actors/inherit.cfa
r0794365 rc880a7b 15 15 void ^?{}( D_msg & this ) { mutex(sout) sout | 'A'; } 16 16 17 Allocation handle() {17 allocation handle() { 18 18 return Finished; 19 19 } 20 20 21 Allocation receive( Server & receiver, D_msg & msg ) { return handle(); }22 Allocation receive( Server & receiver, D_msg2 & msg ) { return handle(); }23 Allocation receive( Server2 & receiver, D_msg & msg ) { return Delete; }24 Allocation receive( Server2 & receiver, D_msg2 & msg ) { return Delete; }21 allocation receive( Server & receiver, D_msg & msg ) { return handle(); } 22 allocation receive( Server & receiver, D_msg2 & msg ) { return handle(); } 23 allocation receive( Server2 & receiver, D_msg & msg ) { return Delete; } 24 allocation receive( Server2 & receiver, D_msg2 & msg ) { return Delete; } 25 25 26 26 int main() { -
tests/concurrency/actors/matrix.cfa
r0794365 rc880a7b 24 24 } 25 25 26 Allocation receive( derived_actor & receiver, derived_msg & msg ) {26 allocation receive( derived_actor & receiver, derived_msg & msg ) { 27 27 for ( unsigned int i = 0; i < yc; i += 1 ) { // multiply X_row by Y_col and sum products 28 28 msg.Z[i] = 0; -
tests/concurrency/actors/pingpong.cfa
r0794365 rc880a7b 19 19 size_t times = 100000; 20 20 21 Allocation receive( ping & receiver, p_msg & msg ) {21 allocation receive( ping & receiver, p_msg & msg ) { 22 22 msg.count++; 23 23 if ( msg.count > times ) return Finished; 24 24 25 Allocation retval = Nodelete;25 allocation retval = Nodelete; 26 26 if ( msg.count == times ) retval = Finished; 27 27 *po << msg; … … 29 29 } 30 30 31 Allocation receive( pong & receiver, p_msg & msg ) {31 allocation receive( pong & receiver, p_msg & msg ) { 32 32 msg.count++; 33 33 if ( msg.count > times ) return Finished; 34 34 35 Allocation retval = Nodelete;35 allocation retval = Nodelete; 36 36 if ( msg.count == times ) retval = Finished; 37 37 *pi << msg; -
tests/concurrency/actors/static.cfa
r0794365 rc880a7b 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 & receiver, derived_msg & msg ) { 22 22 if ( msg.cnt >= Times ) { 23 23 sout | "Done"; -
tests/concurrency/actors/types.cfa
r0794365 rc880a7b 20 20 21 21 // this isn't a valid receive routine since int is not a message type 22 Allocation receive( derived_actor & receiver, int i ) with( receiver ) {22 allocation receive( derived_actor & receiver, int i ) with( receiver ) { 23 23 mutex(sout) sout | i; 24 24 counter++; … … 27 27 } 28 28 29 Allocation receive( derived_actor & receiver, d_msg & msg ) {29 allocation receive( derived_actor & receiver, d_msg & msg ) { 30 30 return receive( receiver, msg.num ); 31 31 } … … 36 36 }; 37 37 38 Allocation receive( derived_actor2 & receiver, d_msg & msg ) {38 allocation receive( derived_actor2 & receiver, 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 & receiver, 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 & receiver, d_msg2 & msg ) { 57 57 mutex(sout) sout | msg.num; 58 58 return Finished;
Note: See TracChangeset
for help on using the changeset viewer.