Changes in / [aec20700:a8b87d3]


Ignore:
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/printer.cfa

    raec20700 ra8b87d3  
    66
    77void ?{}( sendfile_stats_t & this ) {
    8         this.maxfd = 0;
    9         this.close = 0;
    108        this.calls = 0;
    119        this.tries = 0;
     
    2018
    2119void push(sendfile_stats_t & from, sendfile_stats_t & to) {
    22         to.maxfd = max( to.maxfd, from.maxfd);
    23         to.close += from.close; from.close = 0;
    24         to.calls += from.calls; from.calls = 0;
    25         to.tries += from.tries; from.tries = 0;
    26         to.header += from.header; from.header = 0;
    27         to.splcin += from.splcin; from.splcin = 0;
    28         to.splcot += from.splcot; from.splcot = 0;
     20        __atomic_fetch_add(&to.calls, from.calls, __ATOMIC_RELAXED); from.calls = 0;
     21        __atomic_fetch_add(&to.tries, from.tries, __ATOMIC_RELAXED); from.tries = 0;
     22        __atomic_fetch_add(&to.header, from.header, __ATOMIC_RELAXED); from.header = 0;
     23        __atomic_fetch_add(&to.splcin, from.splcin, __ATOMIC_RELAXED); from.splcin = 0;
     24        __atomic_fetch_add(&to.splcot, from.splcot, __ATOMIC_RELAXED); from.splcot = 0;
    2925        for(i; zipf_cnts) {
    30                 to.avgrd[i].calls += from.avgrd[i].calls; from.avgrd[i].calls = 0;
    31                 to.avgrd[i].bytes += from.avgrd[i].bytes; from.avgrd[i].bytes = 0;
     26                __atomic_fetch_add(&to.avgrd[i].calls, from.avgrd[i].calls, __ATOMIC_RELAXED); from.avgrd[i].calls = 0;
     27                __atomic_fetch_add(&to.avgrd[i].bytes, from.avgrd[i].bytes, __ATOMIC_RELAXED); from.avgrd[i].bytes = 0;
    3228        };
    3329}
     
    4036
    4137void push(acceptor_stats_t & from, acceptor_stats_t & to) {
    42         to.creates += from.creates; from.creates = 0;
    43         to.accepts += from.accepts; from.accepts = 0;
    44         to.eagains += from.eagains; from.eagains = 0;
     38        __atomic_fetch_add(&to.creates, from.creates, __ATOMIC_RELAXED); from.creates = 0;
     39        __atomic_fetch_add(&to.accepts, from.accepts, __ATOMIC_RELAXED); from.accepts = 0;
     40        __atomic_fetch_add(&to.eagains, from.eagains, __ATOMIC_RELAXED); from.eagains = 0;
    4541}
    4642
     
    5753void main(StatsPrinter & this) {
    5854        LOOP: for() {
     55                waitfor( ^?{} : this) {
     56                        break LOOP;
     57                }
     58                or else {}
     59
    5960                wait(this.var, 10`s);
    6061
     
    7879
    7980                        double ratio = ((double)tries) / calls;
    80                         uint64_t accp_open = this.stats.accpt.accepts;
    81                         uint64_t accp_clse = this.stats.send.close;
    82                         uint64_t accp_live = accp_open - accp_clse;
    8381
    84                         sout | "----- Acceptor Stats -----";
    85                         sout | "accepts : " | eng3(accp_open) |"opened," | eng3(accp_clse) |"closed," | eng3(accp_live) |"live";
    86                         sout | "accept  : " | eng3(this.stats.accpt.accepts) | "calls," | eng3(this.stats.accpt.eagains) | "eagains," | eng3(this.stats.accpt.creates) | " thrds";
    87                         sout | nl;
     82                        if(this.stats.accpt.accepts > 0) {
     83                                sout | "----- Acceptor Stats -----";
     84                                sout | "accept  : " | eng3(this.stats.accpt.accepts) | "calls," | eng3(this.stats.accpt.eagains) | "eagains," | eng3(this.stats.accpt.creates) | " thrds";
     85                                sout | nl;
     86                        }
    8887
    8988                        sout | "----- Connection Stats -----";
    90                         sout | "max fd    : " | this.stats.send.maxfd;
    9189                        sout | "sendfile  : " | eng3(calls) | "calls," | eng3(tries) | "tries (" | ratio | " try/call)";
    9290                        sout | "            " | eng3(header) | "header," | eng3(splcin) | "splice in," | eng3(splcot) | "splice out";
     
    9795                        }
    9896                }
    99 
    100                 waitfor( ^?{} : this) {
    101                         break LOOP;
    102                 }
    103                 or else {}
    10497        }
    10598}
  • benchmark/io/http/printer.hfa

    raec20700 ra8b87d3  
    1010
    1111struct sendfile_stats_t {
    12         volatile uint64_t maxfd;
    13         volatile uint64_t close;
    1412        volatile uint64_t calls;
    1513        volatile uint64_t tries;
  • libcfa/src/concurrency/kernel/fwd.hfa

    raec20700 ra8b87d3  
    289289                                        if( expected == 2p ) {
    290290                                                while( this.ptr != 1p ) Pause();
    291                                                 /* paranoid */ verify( this.ptr == 1p );
     291                                                /* paranoid */ verify( this.ptr != 1p );
    292292                                                return true;
    293293                                        }
Note: See TracChangeset for help on using the changeset viewer.