Changeset 7edf912


Ignore:
Timestamp:
Sep 17, 2023, 10:17:50 PM (7 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
a2c2363
Parents:
50be8af
Message:

formatting, replace constructor calls with set_allocation calls

Location:
tests/concurrency/actors
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrency/actors/dynamic.cfa

    r50be8af r7edf912  
    99struct derived_actor { inline actor; };
    1010struct derived_msg {
    11     inline message;
    12     int cnt;
     11        inline message;
     12        int cnt;
    1313};
    1414
    1515void ?{}( derived_msg & this, int cnt ) {
    16     ((message &) this){ Delete };
    17     this.cnt = cnt;
     16        set_allocation( this, Delete );
     17        this.cnt = cnt;
    1818}
    1919void ?{}( derived_msg & this ) { ((derived_msg &)this){ 0 }; }
    2020
    2121allocation receive( derived_actor & receiver, derived_msg & msg ) {
    22     if ( msg.cnt >= Times ) {
    23         sout | "Done";
    24         return Delete;
    25     }
    26     derived_msg * d_msg = alloc();
    27     (*d_msg){ msg.cnt + 1 };
    28     derived_actor * d_actor = alloc();
    29     (*d_actor){};
    30     *d_actor | *d_msg;
    31     return Delete;
     22        if ( msg.cnt >= Times ) {
     23                sout | "Done";
     24                return Delete;
     25        }
     26        derived_msg * d_msg = alloc();
     27        (*d_msg){ msg.cnt + 1 };
     28        derived_actor * d_actor = alloc();
     29        (*d_actor){};
     30        *d_actor | *d_msg;
     31        return Delete;
    3232}
    3333
    3434int main( int argc, char * argv[] ) {
    35     switch ( argc ) {
     35        switch ( argc ) {
    3636          case 2:
    3737                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
     
    4545        } // switch
    4646
    47     sout | "starting";
     47        sout | "starting";
    4848
    49     executor e{ 0, 1, 1, false };
    50     start_actor_system( e );
     49        executor e{ 0, 1, 1, false };
     50        start_actor_system( e );
    5151
    52     sout | "started";
     52        sout | "started";
    5353
    54     derived_msg * d_msg = alloc();
    55     (*d_msg){};
    56     derived_actor * d_actor = alloc();
    57     (*d_actor){};
    58     *d_actor | *d_msg;
     54        derived_msg * d_msg = alloc();
     55        (*d_msg){};
     56        derived_actor * d_actor = alloc();
     57        (*d_actor){};
     58        *d_actor | *d_msg;
    5959
    60     sout | "stopping";
     60        sout | "stopping";
    6161
    62     stop_actor_system();
     62        stop_actor_system();
    6363
    64     sout | "stopped";
    65 
    66     return 0;
     64        sout | "stopped";
    6765}
  • tests/concurrency/actors/executor.cfa

    r50be8af r7edf912  
    1010static int ids = 0;
    1111struct d_actor {
    12     inline actor;
    13     d_actor * gstart;
    14     int id, rounds, recs, sends;
     12        inline actor;
     13        d_actor * gstart;
     14        int id, rounds, recs, sends;
    1515};
    1616void ?{}( d_actor & this ) with(this) {
    17     id = ids++;
    18     gstart = (&this + (id / Set * Set - id)); // remember group-start array-element
    19     rounds = Set * Rounds;      // send at least one message to each group member
    20     recs = 0;
    21     sends = 0;
     17        id = ids++;
     18        gstart = (&this + (id / Set * Set - id)); // remember group-start array-element
     19        rounds = Set * Rounds;  // send at least one message to each group member
     20        recs = 0;
     21        sends = 0;
    2222}
    2323
     
    2525
    2626allocation receive( d_actor & this, d_msg & msg ) with( this ) {
    27     if ( recs == rounds ) return Finished;
    28     if ( recs % Batch == 0 ) {
    29         for ( i; Batch ) {
    30             gstart[sends % Set] | shared_msg;
    31             sends += 1;
    32         }
    33     }
    34     recs += 1;
    35     return Nodelete;
     27        if ( recs == rounds ) return Finished;
     28        if ( recs % Batch == 0 ) {
     29                for ( i; Batch ) {
     30                        gstart[sends % Set] | shared_msg;
     31                        sends += 1;
     32                }
     33        }
     34        recs += 1;
     35        return Nodelete;
    3636}
    3737
    3838int main( int argc, char * argv[] ) {
    39     switch ( argc ) {
     39        switch ( argc ) {
    4040          case 7:
    4141                if ( strcmp( argv[6], "d" ) != 0 ) {                    // default ?
     
    7272          default:
    7373                exit | "Usage: " | argv[0]
    74             | " [ actors (> 0 && > set && actors % set == 0 ) | 'd' (default " | Actors
     74                        | " [ actors (> 0 && > set && actors % set == 0 ) | 'd' (default " | Actors
    7575                         | ") ] [ set (> 0) | 'd' (default " | Set
    7676                         | ") ] [ rounds (> 0) | 'd' (default " | Rounds
     
    8181        } // switch
    8282
    83     executor e{ Processors, Processors, Processors == 1 ? 1 : Processors * 512, true };
     83        executor e{ Processors, Processors, Processors == 1 ? 1 : Processors * 512, true };
    8484
    85     sout | "starting";
     85        sout | "starting";
    8686
    87     start_actor_system( e );
     87        start_actor_system( e );
    8888
    89     sout | "started";
     89        sout | "started";
    9090
    91     d_actor actors[ Actors ];
     91        d_actor actors[ Actors ];
    9292
    9393        for ( i; Actors ) {
     
    9595        } // for
    9696
    97     sout | "stopping";
     97        sout | "stopping";
    9898
    99     stop_actor_system();
     99        stop_actor_system();
    100100
    101     sout | "stopped";
    102 
    103     return 0;
     101        sout | "stopped";
    104102}
  • tests/concurrency/actors/inherit.cfa

    r50be8af r7edf912  
    1818
    1919allocation handle() {
    20     return Finished;
     20        return Finished;
    2121}
    2222
     
    2727
    2828int main() {
    29     sout | "Start";
    30     {
    31         start_actor_system();
    32         D_msg * dm = alloc();
    33         (*dm){};
    34         D_msg2 * dm2 = alloc();
    35         (*dm2){};
    36         Server2 * s = alloc();
    37         (*s){};
    38         Server2 * s2 = alloc();
    39         (*s2){};
    40         *s | *dm;
    41         *s2 | *dm2;
    42         stop_actor_system();
    43     }
    44     {
    45         start_actor_system();
    46         Server s[2];
    47         D_msg * dm = alloc();
    48         (*dm){};
    49         D_msg2 * dm2 = alloc();
    50         (*dm2){};
    51         s[0] | *dm;
    52         s[1] | *dm2;
    53         stop_actor_system();
    54     }
    55     sout | "Finished";
     29        sout | "Start";
     30        {
     31                start_actor_system();
     32                D_msg * dm = alloc();
     33                (*dm){};
     34                D_msg2 * dm2 = alloc();
     35                (*dm2){};
     36                Server2 * s = alloc();
     37                (*s){};
     38                Server2 * s2 = alloc();
     39                (*s2){};
     40                *s | *dm;
     41                *s2 | *dm2;
     42                stop_actor_system();
     43        }
     44        {
     45                start_actor_system();
     46                Server s[2];
     47                D_msg * dm = alloc();
     48                (*dm){};
     49                D_msg2 * dm2 = alloc();
     50                (*dm2){};
     51                s[0] | *dm;
     52                s[1] | *dm2;
     53                stop_actor_system();
     54        }
     55        sout | "Finished";
    5656}
  • tests/concurrency/actors/inline.cfa

    r50be8af r7edf912  
    33
    44struct d_actor {
    5     inline actor;
     5        inline actor;
    66};
    77struct msg_wrapper {
    8     int b;
    9     inline message;
     8        int b;
     9        inline message;
    1010};
    1111void ^?{}( msg_wrapper & this ) { sout | "msg_wrapper dtor"; }
    1212
    1313struct d_msg {
    14     int m;
    15     inline msg_wrapper;
     14        int m;
     15        inline msg_wrapper;
    1616};
    1717void ?{}( d_msg & this, int m, int b ) { this.m = m; this.b = b; set_allocation( this, Delete ); }
     
    1919
    2020allocation receive( d_actor &, d_msg & msg ) {
    21     sout | msg.m;
    22     sout | msg.b;
    23     return Finished;
     21        sout | msg.m;
     22        sout | msg.b;
     23        return Finished;
    2424}
    2525
    2626struct d_msg2 {
    27     int m;
    28     inline msg_wrapper;
     27        int m;
     28        inline msg_wrapper;
    2929};
    3030void ^?{}( d_msg2 & this ) { sout | "d_msg2 dtor";}
    3131
    3232allocation receive( d_actor &, d_msg2 & msg ) {
    33     sout | msg.m;
    34     return Finished;
     33        sout | msg.m;
     34        return Finished;
    3535}
    3636
    3737int main() {
    38     processor p;
    39     {
    40         start_actor_system();                                // sets up executor
    41         d_actor da;
    42         d_msg * dm = alloc();
    43         (*dm){ 42, 2423 };
    44         da | *dm;
    45         stop_actor_system();                                // waits until actors finish
    46     }
    47     {
    48         start_actor_system();                                // sets up executor
    49         d_actor da;
    50         d_msg2 dm{ 29079 };
    51         set_allocation( dm, Nodelete );
    52         msg_wrapper * mw = &dm;
    53         message * mg = &dm;
    54         virtual_dtor * v = &dm;
    55         da | dm;
    56         stop_actor_system();                                // waits until actors finish
    57     }
     38        processor p;
     39        {
     40                start_actor_system();                                                           // sets up executor
     41                d_actor da;
     42                d_msg * dm = alloc();
     43                (*dm){ 42, 2423 };
     44                da | *dm;
     45                stop_actor_system();                                                            // waits until actors finish
     46        }
     47        {
     48                start_actor_system();                                                           // sets up executor
     49                d_actor da;
     50                d_msg2 dm{ 29079 };
     51                set_allocation( dm, Nodelete );
     52                msg_wrapper * mw = &dm;
     53                message * mg = &dm;
     54                virtual_dtor * v = &dm;
     55                da | dm;
     56                stop_actor_system();                                                            // waits until actors finish
     57        }
    5858}
  • tests/concurrency/actors/matrix.cfa

    r50be8af r7edf912  
    1010
    1111struct derived_msg {
    12     inline message;
    13     int * Z;
     12        inline message;
     13        int * Z;
    1414        int * X;
    15     int ** Y;
     15        int ** Y;
    1616};
    1717
    1818void ?{}( derived_msg & this ) {}
    1919void ?{}( derived_msg & this, int * Z, int * X, int ** Y ) {
    20     ((message &) this){ Nodelete };
    21     this.Z = Z;
    22     this.X = X;
    23     this.Y = Y;
     20        set_allocation( this, Nodelete );
     21        this.Z = Z;
     22        this.X = X;
     23        this.Y = Y;
    2424}
    2525
    2626allocation receive( derived_actor & receiver, derived_msg & msg ) {
    27     for ( unsigned int i = 0; i < yc; i += 1 ) { // multiply X_row by Y_col and sum products
    28         msg.Z[i] = 0;
    29         for ( unsigned int j = 0; j < xc; j += 1 ) {
    30             msg.Z[i] += msg.X[j] * msg.Y[j][i];
    31         } // for
    32     } // for
    33     return Finished;
     27        for ( unsigned int i = 0; i < yc; i += 1 ) { // multiply X_row by Y_col and sum products
     28                msg.Z[i] = 0;
     29                for ( unsigned int j = 0; j < xc; j += 1 ) {
     30                        msg.Z[i] += msg.X[j] * msg.Y[j][i];
     31                } // for
     32        } // for
     33        return Finished;
    3434}
    3535
    3636int main( int argc, char * argv[] ) {
    37     switch ( argc ) {
     37        switch ( argc ) {
    3838          case 5:
    3939                if ( strcmp( argv[4], "d" ) != 0 ) {                    // default ?
     
    6767        } // switch
    6868
    69     unsigned int r, c;
     69        unsigned int r, c;
    7070        int * Z[xr], * X[xr], * Y[xc];
    7171
     
    8686        } // for
    8787
    88     executor e{ Processors, Processors, Processors == 1 ? 1 : Processors * 16, true };
     88        executor e{ Processors, Processors, Processors == 1 ? 1 : Processors * 16, true };
    8989
    90     sout | "starting";
     90        sout | "starting";
    9191
    92     start_actor_system( e );
     92        start_actor_system( e );
    9393
    94     sout | "started";
     94        sout | "started";
    9595
    96     derived_msg messages[xr];
     96        derived_msg messages[xr];
    9797
    98     derived_actor actors[xr];
     98        derived_actor actors[xr];
    9999
    100100        for ( unsigned int r = 0; r < xr; r += 1 ) {
     
    106106        } // for
    107107
    108     sout | "stopping";
     108        sout | "stopping";
    109109
    110     stop_actor_system();
     110        stop_actor_system();
    111111
    112     sout | "stopped";
     112        sout | "stopped";
    113113
    114     for ( r = 0; r < xr; r += 1 ) {                                             // deallocate X and Z matrices
     114        for ( r = 0; r < xr; r += 1 ) {                                         // deallocate X and Z matrices
    115115                free( X[r] );
    116         free( Z[r] );
     116                free( Z[r] );
    117117        } // for
    118118        for ( r = 0; r < xc; r += 1 ) {                                         // deallocate Y matrix
    119         free( Y[r] );
     119                free( Y[r] );
    120120        } // for
    121121}
  • tests/concurrency/actors/pingpong.cfa

    r50be8af r7edf912  
    1010
    1111struct p_msg {
    12     inline message;
    13     size_t count;
     12        inline message;
     13        size_t count;
    1414};
    15 static inline void ?{}( p_msg & this ) { ((message &)this){}; this.count = 0; }
     15//static inline void ?{}( p_msg & this ) { ((message &)this){}; this.count = 0; }
     16static inline void ?{}( p_msg & this ) { this.count = 0; }
    1617
    1718ping * pi;
     
    2021
    2122allocation receive( ping & receiver, p_msg & msg ) {
    22     msg.count++;
    23     if ( msg.count > times ) return Finished;
     23        msg.count++;
     24        if ( msg.count > times ) return Finished;
    2425
    25     allocation retval = Nodelete;
    26     if ( msg.count == times ) retval = Finished;
    27     *po | msg;
    28     return retval;
     26        allocation retval = Nodelete;
     27        if ( msg.count == times ) retval = Finished;
     28        *po | msg;
     29        return retval;
    2930}
    3031
    3132allocation receive( pong & receiver, p_msg & msg ) {
    32     msg.count++;
    33     if ( msg.count > times ) return Finished;
    34    
    35     allocation retval = Nodelete;
    36     if ( msg.count == times ) retval = Finished;
    37     *pi | msg;
    38     return retval;
     33        msg.count++;
     34        if ( msg.count > times ) return Finished;
     35       
     36        allocation retval = Nodelete;
     37        if ( msg.count == times ) retval = Finished;
     38        *pi | msg;
     39        return retval;
    3940}
    4041
     
    4243
    4344int main( int argc, char * argv[] ) {
    44     sout | "start";
     45        sout | "start";
    4546
    46     processor p[Processors - 1];
     47        processor p[Processors - 1];
    4748
    48     start_actor_system( Processors ); // test passing number of processors
     49        start_actor_system( Processors ); // test passing number of processors
     50        ping pi_actor;
     51        pong po_actor;
     52        po = &po_actor;
     53        pi = &pi_actor;
     54        p_msg m;
     55        pi_actor | m;
     56        stop_actor_system();
    4957
    50     ping pi_actor;
    51     pong po_actor;
    52     po = &po_actor;
    53     pi = &pi_actor;
    54     p_msg m;
    55     pi_actor | m;
    56     stop_actor_system();
    57 
    58     sout | "end";
     58        sout | "end";
    5959}
  • tests/concurrency/actors/poison.cfa

    r50be8af r7edf912  
    1111
    1212int main() {
    13     sout | "Start";
     13        sout | "Start";
    1414
    15     sout | "Finished";
    16     {
    17         start_actor_system();
    18         Server s[10];
    19         for ( i; 10 ) {
    20             s[i] | finished_msg;
    21         }
    22         stop_actor_system();
    23     }
     15        sout | "Finished";
     16        {
     17                start_actor_system();
     18                Server s[10];
     19                for ( i; 10 ) {
     20                        s[i] | finished_msg;
     21                }
     22                stop_actor_system();
     23        }
    2424
    25     sout | "Delete";
    26     {
    27         start_actor_system();
    28         for ( i; 10 ) {
    29             Server * s = alloc();
    30             (*s){};
    31             (*s) | delete_msg;
    32         }
    33         stop_actor_system();
    34     }
     25        sout | "Delete";
     26        {
     27                start_actor_system();
     28                for ( i; 10 ) {
     29                        Server * s = alloc();
     30                        (*s){};
     31                        (*s) | delete_msg;
     32                }
     33                stop_actor_system();
     34        }
    3535
    36     sout | "Destroy";
    37     {
    38         start_actor_system();
    39         Server s[10];
    40         for ( i; 10 )
    41             s[i] | destroy_msg;
    42         stop_actor_system();
    43         for ( i; 10 )
    44             if (s[i].val != 777)
    45                 sout | "Error: dtor not called correctly.";
    46     }
     36        sout | "Destroy";
     37        {
     38                start_actor_system();
     39                Server s[10];
     40                for ( i; 10 )
     41                        s[i] | destroy_msg;
     42                stop_actor_system();
     43                for ( i; 10 )
     44                        if (s[i].val != 777)
     45                                sout | "Error: dtor not called correctly.";
     46        }
    4747
    48     sout | "Done";
    49     return 0;
     48        sout | "Done";
    5049}
  • tests/concurrency/actors/static.cfa

    r50be8af r7edf912  
    99struct derived_actor { inline actor; };
    1010struct derived_msg {
    11     inline message;
    12     int cnt;
     11        inline message;
     12        int cnt;
    1313};
    1414
    1515void ?{}( derived_msg & this, int cnt ) {
    16     ((message &) this){ Nodelete };
    17     this.cnt = cnt;
     16        set_allocation( this, Nodelete );
     17        this.cnt = cnt;
    1818}
    1919void ?{}( derived_msg & this ) { ((derived_msg &)this){ 0 }; }
    2020
    2121allocation receive( derived_actor & receiver, derived_msg & msg ) {
    22     if ( msg.cnt >= Times ) {
    23         sout | "Done";
    24         return Finished;
    25     }
    26     msg.cnt++;
    27     receiver | msg;
    28     return Nodelete;
     22        if ( msg.cnt >= Times ) {
     23                sout | "Done";
     24                return Finished;
     25        }
     26        msg.cnt++;
     27        receiver | msg;
     28        return Nodelete;
    2929}
    3030
    3131int main( int argc, char * argv[] ) {
    32     switch ( argc ) {
     32        switch ( argc ) {
    3333          case 2:
    3434                if ( strcmp( argv[1], "d" ) != 0 ) {                    // default ?
     
    4242        } // switch
    4343
    44     sout | "starting";
     44        sout | "starting";
    4545
    46     executor e{ 0, 1, 1, false };
    47     start_actor_system( e );
     46        executor e{ 0, 1, 1, false };
     47        start_actor_system( e );
    4848
    49     sout | "started";
     49        sout | "started";
    5050
    51     derived_msg msg;
     51        derived_msg msg;
    5252
    53     derived_actor actor;
     53        derived_actor actor;
    5454
    55     actor | msg;
     55        actor | msg;
    5656
    57     sout | "stopping";
     57        sout | "stopping";
    5858
    59     stop_actor_system();
     59        stop_actor_system();
    6060
    61     sout | "stopped";
    62 
    63     return 0;
     61        sout | "stopped";
    6462}
  • tests/concurrency/actors/types.cfa

    r50be8af r7edf912  
    99
    1010struct derived_actor {
    11     inline actor;
    12     int counter;
     11        inline actor;
     12        int counter;
    1313};
    1414static inline void ?{}( derived_actor & this ) { ((actor &)this){}; this.counter = 0; }
    1515
    1616struct d_msg {
    17     inline message;
    18     int num;
     17        inline message;
     18        int num;
    1919};
    2020
    2121// this isn't a valid receive routine since int is not a message type
    2222allocation receive( derived_actor & receiver, int i ) with( receiver ) {
    23     mutex(sout) sout | i;
    24     counter++;
    25     if ( counter == 2 ) return Finished;
    26     return Nodelete;
     23        mutex(sout) sout | i;
     24        counter++;
     25        if ( counter == 2 ) return Finished;
     26        return Nodelete;
    2727}
    2828
    2929allocation receive( derived_actor & receiver, d_msg & msg ) {
    30     return receive( receiver, msg.num );
     30        return receive( receiver, msg.num );
    3131}
    3232
    3333struct derived_actor2 {
    34     struct nested { int i; }; // testing nested before inline
    35     inline actor;
     34        struct nested { int i; }; // testing nested before inline
     35        inline actor;
    3636};
    3737
    3838allocation receive( derived_actor2 & receiver, d_msg & msg ) {
    39     mutex(sout) sout | msg.num;
    40     return Finished;
     39        mutex(sout) sout | msg.num;
     40        return Finished;
    4141}
    4242
     
    4444struct derived_actor4 { inline derived_actor3; };
    4545struct d_msg2 {
    46     inline message;
    47     int num;
     46        inline message;
     47        int num;
    4848};
    4949
    5050allocation receive( derived_actor3 & receiver, d_msg & msg ) {
    51     mutex(sout) sout | msg.num;
    52     if ( msg.num == -1 ) return Nodelete;
    53     return Finished;
     51        mutex(sout) sout | msg.num;
     52        if ( msg.num == -1 ) return Nodelete;
     53        return Finished;
    5454}
    5555
    5656allocation receive( derived_actor3 & receiver, d_msg2 & msg ) {
    57     mutex(sout) sout | msg.num;
    58     return Finished;
     57        mutex(sout) sout | msg.num;
     58        return Finished;
    5959}
    6060
     
    6262
    6363int main( int argc, char * argv[] ) {
    64     sout | "start";
     64        sout | "start";
    6565
    66     processor p[Processors - 1];
     66        processor p[Processors - 1];
    6767
    68     sout | "basic test";
    69     start_actor_system( Processors ); // test passing number of processors
    70     derived_actor a;
    71     d_msg b, c;
    72     b.num = 1;
    73     c.num = 2;
    74     a | b | c;
    75     stop_actor_system();
     68        sout | "basic test";
     69        start_actor_system( Processors ); // test passing number of processors
     70        derived_actor a;
     71        d_msg b, c;
     72        b.num = 1;
     73        c.num = 2;
     74        a | b | c;
     75        stop_actor_system();
    7676
    77     sout | "same message and different actors test";
    78     start_actor_system(); // let system detect # of processors
    79     derived_actor2 d_ac2_0, d_ac2_1;
    80     d_msg d_ac2_msg;
    81     d_ac2_msg.num = 3;
    82     d_ac2_0 | d_ac2_msg;
    83     d_ac2_1 | d_ac2_msg;
    84     stop_actor_system();
     77        sout | "same message and different actors test";
     78        start_actor_system(); // let system detect # of processors
     79        derived_actor2 d_ac2_0, d_ac2_1;
     80        d_msg d_ac2_msg;
     81        d_ac2_msg.num = 3;
     82        d_ac2_0 | d_ac2_msg;
     83        d_ac2_1 | d_ac2_msg;
     84        stop_actor_system();
    8585
    86    
    87     {
    88         sout | "same message and different actor types test";
    89         executor e{ 0, Processors, Processors == 1 ? 1 : Processors * 4, false };
    90         start_actor_system( e ); // pass an explicit executor
    91         derived_actor2 d_ac2_2;
    92         derived_actor3 d_ac3_0;
    93         d_msg d_ac23_msg;
    94         d_ac23_msg.num = 4;
    95         d_ac3_0 | d_ac23_msg;
    96         d_ac2_2 | d_ac23_msg;
    97         stop_actor_system();
    98     } // RAII to clean up executor
     86       
     87        {
     88                sout | "same message and different actor types test";
     89                executor e{ 0, Processors, Processors == 1 ? 1 : Processors * 4, false };
     90                start_actor_system( e ); // pass an explicit executor
     91                derived_actor2 d_ac2_2;
     92                derived_actor3 d_ac3_0;
     93                d_msg d_ac23_msg;
     94                d_ac23_msg.num = 4;
     95                d_ac3_0 | d_ac23_msg;
     96                d_ac2_2 | d_ac23_msg;
     97                stop_actor_system();
     98        } // RAII to clean up executor
    9999
    100     {
    101         sout | "different message types, one actor test";
    102         executor e{ 1, Processors, Processors == 1 ? 1 : Processors * 4, true };
    103         start_actor_system( Processors );
    104         derived_actor3 a3;
    105         d_msg b1;
    106         d_msg2 c2;
    107         b1.num = -1;
    108         c2.num = 5;
    109         a3 | b1 | c2;
    110         stop_actor_system();
    111     } // RAII to clean up executor
     100        {
     101                sout | "different message types, one actor test";
     102                executor e{ 1, Processors, Processors == 1 ? 1 : Processors * 4, true };
     103                start_actor_system( Processors );
     104                derived_actor3 a3;
     105                d_msg b1;
     106                d_msg2 c2;
     107                b1.num = -1;
     108                c2.num = 5;
     109                a3 | b1 | c2;
     110                stop_actor_system();
     111        } // RAII to clean up executor
    112112
    113     {
    114         sout | "nested inheritance actor test";
    115         executor e{ 1, Processors, Processors == 1 ? 1 : Processors * 4, true };
    116         start_actor_system( Processors );
    117         derived_actor4 a4;
    118         d_msg b1;
    119         d_msg2 c2;
    120         b1.num = -1;
    121         c2.num = 5;
    122         a4 | b1 | c2;
    123         stop_actor_system();
    124     } // RAII to clean up executor
     113        {
     114                sout | "nested inheritance actor test";
     115                executor e{ 1, Processors, Processors == 1 ? 1 : Processors * 4, true };
     116                start_actor_system( Processors );
     117                derived_actor4 a4;
     118                d_msg b1;
     119                d_msg2 c2;
     120                b1.num = -1;
     121                c2.num = 5;
     122                a4 | b1 | c2;
     123                stop_actor_system();
     124        } // RAII to clean up executor
    125125
    126     sout | "end";
     126        sout | "end";
    127127}
Note: See TracChangeset for help on using the changeset viewer.