Changes in benchmark/io/http/main.cfa [d9c2284:e95a117]
- File:
-
- 1 edited
-
benchmark/io/http/main.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/main.cfa
rd9c2284 re95a117 93 93 &wait_connect = &chan; 94 94 95 int pipe_cnt = options.clopts.nworkers * 2;96 int pipe_off;97 int * fds;98 [fds, pipe_off] = filefds( pipe_cnt );99 for(i; 0 ~ pipe_cnt ~ 2) {100 int ret = pipe(&fds[pipe_off + i]);101 if( ret < 0 ) { abort( "pipe error: (%d) %s\n", (int)errno, strerror(errno) ); }102 }103 104 95 { 105 96 ServerProc procs[options.clopts.nprocs]; 106 97 { 107 98 Worker workers[options.clopts.nworkers]; 108 for(i; options.clopts.nworkers) {109 if( options.file_cache.fixed_fds ) {110 workers[i].pipe[0] = pipe_off + (i * 2) + 0;111 workers[i].pipe[1] = pipe_off + (i * 2) + 1;112 }113 else {114 workers[i].pipe[0] = fds[pipe_off + (i * 2) + 0];115 workers[i].pipe[1] = fds[pipe_off + (i * 2) + 1];116 }117 unpark( workers[i] __cfaabi_dbg_ctx2 );118 }119 99 printf("%d workers started on %d processors\n", options.clopts.nworkers, options.clopts.nprocs); 120 100 { … … 137 117 printf("Workers Closed\n"); 138 118 } 139 140 for(i; pipe_cnt) {141 ret = close( fds[pipe_off + i] );142 if(ret < 0) {143 abort( "close pipe error: (%d) %s\n", (int)errno, strerror(errno) );144 }145 }146 free(fds);147 119 } 148 120
Note:
See TracChangeset
for help on using the changeset viewer.