Changes in / [c600df1:1ed9cb63]


Ignore:
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/http_ring.cpp

    rc600df1 r1ed9cb63  
    118118// Get a fix reply based on the return code
    119119const char * http_msgs[] = {
    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",
     120        "HTTP/1.1 200 OK\r\nServer: HttpForall\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: HttpForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",
     122        "HTTP/1.1 404 Not Found\r\nServer: HttpForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",
     123        "HTTP/1.1 405 Method Not \r\nServer: HttpForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",
     124        "HTTP/1.1 408 Request Timeout\r\nServer: HttpForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",
     125        "HTTP/1.1 413 Payload Too Large\r\nServer: HttpForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",
     126        "HTTP/1.1 414 URI Too Long\r\nServer: HttpForall\r\nContent-Type: text/plain\r\nContent-Length: 0 \r\n\r\n",
    127127};
    128128static_assert( KNOWN_CODES == (sizeof(http_msgs) / sizeof(http_msgs[0])) );
  • benchmark/io/http/options.cfa

    rc600df1 r1ed9cb63  
    5252        // bool sqkpoll = false;
    5353        // bool iokpoll = false;
    54         unsigned nentries = 16;
     54        unsigned nentries = 0;
    5555        bool isolate = false;
    5656
     
    7979        parse_args( argc, argv, opt, opt_cnt, "[OPTIONS]... [PATH]\ncforall http server", left );
    8080
    81         if( !is_pow2(nentries) ) {
     81        if( nentries != 0 && !is_pow2(nentries) ) {
    8282                unsigned v = nentries;
    8383                v--;
  • benchmark/io/http/protocol.cfa

    rc600df1 r1ed9cb63  
    214214
    215215const char * original_http_msgs[] = {
    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",
     216        "HTTP/1.1 200 OK\nServer: HttpForall\nDate: %s \nContent-Type: text/plain\nContent-Length: ",
     217        "HTTP/1.1 200 OK\nServer: HttpForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 15\n\nHello, World!\n\n",
     218        "HTTP/1.1 400 Bad Request\nServer: HttpForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
     219        "HTTP/1.1 404 Not Found\nServer: HttpForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
     220        "HTTP/1.1 405 Method Not Allowed\nServer: HttpForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
     221        "HTTP/1.1 408 Request Timeout\nServer: HttpForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
     222        "HTTP/1.1 413 Payload Too Large\nServer: HttpForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
     223        "HTTP/1.1 414 URI Too Long\nServer: HttpForall\nDate: %s \nContent-Type: text/plain\nContent-Length: 0 \n\n",
    224224};
    225225
     
    251251                Time now = timeHiRes();
    252252                strftime( buff, 100, "%a, %d %b %Y %H:%M:%S %Z", now );
    253                 sout | "Updated date to '" | buff | "'";
     253                if( options.log ) sout | "Updated date to '" | buff | "'";
    254254
    255255                for(i; KNOWN_CODES) {
     
    264264                this.idx = (this.idx + 1) % 2;
    265265
    266                 sout | "Date thread sleeping";
     266                if( options.log ) sout | "Date thread sleeping";
    267267
    268268                sleep(1`s);
  • libcfa/src/concurrency/io.cfa

    rc600df1 r1ed9cb63  
    183183                ctx.proc->io.pending = false;
    184184
    185                 ready_schedule_lock();
    186185                __cfa_io_drain( proc );
    187                 ready_schedule_unlock();
    188186                // for(i; 2) {
    189187                //      unsigned idx = proc->rdq.id + i;
     
    316314                ctx->proc->io.dirty   = true;
    317315                if(sq.to_submit > 30 || !lazy) {
     316                        ready_schedule_lock();
    318317                        __cfa_io_flush( ctx->proc );
     318                        ready_schedule_unlock();
    319319                }
    320320        }
  • libcfa/src/concurrency/kernel.cfa

    rc600df1 r1ed9cb63  
    196196
    197197                        if( !readyThread ) {
     198                                ready_schedule_lock();
    198199                                __cfa_io_flush( this );
     200                                ready_schedule_unlock();
     201
    199202                                readyThread = __next_thread_slow( this->cltr );
    200203                        }
     
    277280
    278281                        if(this->io.pending && !this->io.dirty) {
     282                                ready_schedule_lock();
    279283                                __cfa_io_flush( this );
     284                                ready_schedule_unlock();
    280285                        }
    281286
     
    317322
    318323                                // Don't block if we are done
    319                                 if( __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST) ) break MAIN_LOOP;
     324                                if( __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST) ) {
     325                                        ready_schedule_unlock();
     326                                        break MAIN_LOOP;
     327                                }
    320328
    321329                                __STATS( __tls_stats()->ready.sleep.halts++; )
     
    939947                        /* paranoid */ verifyf( it, "Unexpected null iterator, at index %u of %u\n", i, count);
    940948                        /* paranoid */ verify( it->local_data->this_stats );
     949                        // __print_stats( it->local_data->this_stats, cltr->print_stats, "Processor", it->name, (void*)it );
    941950                        __tally_stats( cltr->stats, it->local_data->this_stats );
    942951                        it = &(*it)`next;
     
    948957                // this doesn't solve all problems but does solve many
    949958                // so it's probably good enough
     959                disable_interrupts();
    950960                uint_fast32_t last_size = ready_mutate_lock();
    951961
     
    955965                // Unlock the RWlock
    956966                ready_mutate_unlock( last_size );
     967                enable_interrupts();
    957968        }
    958969
Note: See TracChangeset for help on using the changeset viewer.