Changeset 50be8af for tests/concurrency/actors/executor.cfa
- Timestamp:
- Sep 17, 2023, 11:19:08 AM (13 months ago)
- Branches:
- master
- Children:
- 7edf912
- Parents:
- 697c957
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/actors/executor.cfa
r697c957 r50be8af 40 40 case 7: 41 41 if ( strcmp( argv[6], "d" ) != 0 ) { // default ? 42 BufSize = ato i( argv[6] );43 if ( BufSize < 0 ) goto Usage;42 BufSize = ato( argv[6] ); 43 if ( BufSize < 0 ) fallthru default; 44 44 } // if 45 45 case 6: 46 46 if ( strcmp( argv[5], "d" ) != 0 ) { // default ? 47 Batch = ato i( argv[5] );48 if ( Batch < 1 ) goto Usage;47 Batch = ato( argv[5] ); 48 if ( Batch < 1 ) fallthru default; 49 49 } // if 50 50 case 5: 51 51 if ( strcmp( argv[4], "d" ) != 0 ) { // default ? 52 Processors = ato i( argv[4] );53 if ( Processors < 1 ) goto Usage;52 Processors = ato( argv[4] ); 53 if ( Processors < 1 ) fallthru default; 54 54 } // if 55 55 case 4: 56 56 if ( strcmp( argv[3], "d" ) != 0 ) { // default ? 57 Rounds = ato i( argv[3] );58 if ( Rounds < 1 ) goto Usage;57 Rounds = ato( argv[3] ); 58 if ( Rounds < 1 ) fallthru default; 59 59 } // if 60 60 case 3: 61 61 if ( strcmp( argv[2], "d" ) != 0 ) { // default ? 62 Set = ato i( argv[2] );63 if ( Set < 1 ) goto Usage;62 Set = ato( argv[2] ); 63 if ( Set < 1 ) fallthru default; 64 64 } // if 65 65 case 2: 66 66 if ( strcmp( argv[1], "d" ) != 0 ) { // default ? 67 Actors = ato i( argv[1] );68 if ( Actors < 1 || Actors <= Set || Actors % Set != 0 ) goto Usage;67 Actors = ato( argv[1] ); 68 if ( Actors < 1 || Actors <= Set || Actors % Set != 0 ) fallthru default; 69 69 } // if 70 70 case 1: // use defaults 71 71 break; 72 72 default: 73 Usage: 74 sout | "Usage: " | argv[0] 73 exit | "Usage: " | argv[0] 75 74 | " [ actors (> 0 && > set && actors % set == 0 ) | 'd' (default " | Actors 76 75 | ") ] [ set (> 0) | 'd' (default " | Set … … 80 79 | ") ] [ buffer size (>= 0) | 'd' (default " | BufSize 81 80 | ") ]" ; 82 exit( EXIT_FAILURE );83 81 } // switch 84 82 85 83 executor e{ Processors, Processors, Processors == 1 ? 1 : Processors * 512, true }; 86 84 87 printf("starting\n");85 sout | "starting"; 88 86 89 87 start_actor_system( e ); 90 88 91 printf("started\n");89 sout | "started"; 92 90 93 91 d_actor actors[ Actors ]; … … 97 95 } // for 98 96 99 printf("stopping\n");97 sout | "stopping"; 100 98 101 99 stop_actor_system(); 102 100 103 printf("stopped\n");101 sout | "stopped"; 104 102 105 103 return 0;
Note: See TracChangeset
for help on using the changeset viewer.