Changes in / [1ed9cb63:c600df1]
- Files:
-
- 5 edited
-
benchmark/io/http/http_ring.cpp (modified) (1 diff)
-
benchmark/io/http/options.cfa (modified) (2 diffs)
-
benchmark/io/http/protocol.cfa (modified) (3 diffs)
-
libcfa/src/concurrency/io.cfa (modified) (2 diffs)
-
libcfa/src/concurrency/kernel.cfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/http_ring.cpp
r1ed9cb63 rc600df1 118 118 // Get a fix reply based on the return code 119 119 const char * http_msgs[] = { 120 "HTTP/1.1 200 OK\r\nServer: Htt pForall\r\nContent-Type: text/plain\r\nContent-Length: 15\r\nConnection: keep-alive\r\n\r\nHello, World!\r\n",121 "HTTP/1.1 400 Bad Request\r\nServer: Htt pForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",122 "HTTP/1.1 404 Not Found\r\nServer: Htt pForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",123 "HTTP/1.1 405 Method Not \r\nServer: Htt pForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",124 "HTTP/1.1 408 Request Timeout\r\nServer: Htt pForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",125 "HTTP/1.1 413 Payload Too Large\r\nServer: Htt pForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",126 "HTTP/1.1 414 URI Too Long\r\nServer: Htt pForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",120 "HTTP/1.1 200 OK\r\nServer: HttoForall\r\nContent-Type: text/plain\r\nContent-Length: 15\r\nConnection: keep-alive\r\n\r\nHello, World!\r\n", 121 "HTTP/1.1 400 Bad Request\r\nServer: HttoForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n", 122 "HTTP/1.1 404 Not Found\r\nServer: HttoForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n", 123 "HTTP/1.1 405 Method Not \r\nServer: HttoForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n", 124 "HTTP/1.1 408 Request Timeout\r\nServer: HttoForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n", 125 "HTTP/1.1 413 Payload Too Large\r\nServer: HttoForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n", 126 "HTTP/1.1 414 URI Too Long\r\nServer: HttoForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n", 127 127 }; 128 128 static_assert( KNOWN_CODES == (sizeof(http_msgs) / sizeof(http_msgs[0])) ); -
benchmark/io/http/options.cfa
r1ed9cb63 rc600df1 52 52 // bool sqkpoll = false; 53 53 // bool iokpoll = false; 54 unsigned nentries = 0;54 unsigned nentries = 16; 55 55 bool isolate = false; 56 56 … … 79 79 parse_args( argc, argv, opt, opt_cnt, "[OPTIONS]... [PATH]\ncforall http server", left ); 80 80 81 if( nentries != 0 &&!is_pow2(nentries) ) {81 if( !is_pow2(nentries) ) { 82 82 unsigned v = nentries; 83 83 v--; -
benchmark/io/http/protocol.cfa
r1ed9cb63 rc600df1 214 214 215 215 const char * original_http_msgs[] = { 216 "HTTP/1.1 200 OK\nServer: Htt pForall\nDate: %s \nContent-Type: text/plain\nContent-Length: ",217 "HTTP/1.1 200 OK\nServer: Htt pForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 15\n\nHello, World!\n\n",218 "HTTP/1.1 400 Bad Request\nServer: Htt pForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",219 "HTTP/1.1 404 Not Found\nServer: Htt pForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",220 "HTTP/1.1 405 Method Not Allowed\nServer: Htt pForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",221 "HTTP/1.1 408 Request Timeout\nServer: Htt pForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",222 "HTTP/1.1 413 Payload Too Large\nServer: Htt pForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",223 "HTTP/1.1 414 URI Too Long\nServer: Htt pForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",216 "HTTP/1.1 200 OK\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: ", 217 "HTTP/1.1 200 OK\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 15\n\nHello, World!\n\n", 218 "HTTP/1.1 400 Bad Request\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n", 219 "HTTP/1.1 404 Not Found\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n", 220 "HTTP/1.1 405 Method Not Allowed\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n", 221 "HTTP/1.1 408 Request Timeout\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n", 222 "HTTP/1.1 413 Payload Too Large\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n", 223 "HTTP/1.1 414 URI Too Long\nServer: HttoForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n", 224 224 }; 225 225 … … 251 251 Time now = timeHiRes(); 252 252 strftime( buff, 100, "%a, %d %b %Y %H:%M:%S %Z", now ); 253 if( options.log )sout | "Updated date to '" | buff | "'";253 sout | "Updated date to '" | buff | "'"; 254 254 255 255 for(i; KNOWN_CODES) { … … 264 264 this.idx = (this.idx + 1) % 2; 265 265 266 if( options.log )sout | "Date thread sleeping";266 sout | "Date thread sleeping"; 267 267 268 268 sleep(1`s); -
libcfa/src/concurrency/io.cfa
r1ed9cb63 rc600df1 183 183 ctx.proc->io.pending = false; 184 184 185 ready_schedule_lock(); 185 186 __cfa_io_drain( proc ); 187 ready_schedule_unlock(); 186 188 // for(i; 2) { 187 189 // unsigned idx = proc->rdq.id + i; … … 314 316 ctx->proc->io.dirty = true; 315 317 if(sq.to_submit > 30 || !lazy) { 316 ready_schedule_lock();317 318 __cfa_io_flush( ctx->proc ); 318 ready_schedule_unlock();319 319 } 320 320 } -
libcfa/src/concurrency/kernel.cfa
r1ed9cb63 rc600df1 196 196 197 197 if( !readyThread ) { 198 ready_schedule_lock();199 198 __cfa_io_flush( this ); 200 ready_schedule_unlock();201 202 199 readyThread = __next_thread_slow( this->cltr ); 203 200 } … … 280 277 281 278 if(this->io.pending && !this->io.dirty) { 282 ready_schedule_lock();283 279 __cfa_io_flush( this ); 284 ready_schedule_unlock();285 280 } 286 281 … … 322 317 323 318 // Don't block if we are done 324 if( __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST) ) { 325 ready_schedule_unlock(); 326 break MAIN_LOOP; 327 } 319 if( __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST) ) break MAIN_LOOP; 328 320 329 321 __STATS( __tls_stats()->ready.sleep.halts++; ) … … 947 939 /* paranoid */ verifyf( it, "Unexpected null iterator, at index %u of %u\n", i, count); 948 940 /* paranoid */ verify( it->local_data->this_stats ); 949 // __print_stats( it->local_data->this_stats, cltr->print_stats, "Processor", it->name, (void*)it );950 941 __tally_stats( cltr->stats, it->local_data->this_stats ); 951 942 it = &(*it)`next; … … 957 948 // this doesn't solve all problems but does solve many 958 949 // so it's probably good enough 959 disable_interrupts();960 950 uint_fast32_t last_size = ready_mutate_lock(); 961 951 … … 965 955 // Unlock the RWlock 966 956 ready_mutate_unlock( last_size ); 967 enable_interrupts();968 957 } 969 958
Note:
See TracChangeset
for help on using the changeset viewer.