Changeset 8c58e73


Ignore:
Timestamp:
Jun 8, 2022, 7:24:27 PM (23 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
137974a
Parents:
bbf61838
Message:

Removed webserver feature to have multiple clusters (it never actually worked)

Location:
benchmark/io/http
Files:
4 edited

Legend:

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

    rbbf61838 r8c58e73  
    163163        #endif
    164164
    165         options.clopts.instance[options.clopts.cltr_cnt] = &this.self;
    166         options.clopts.cltr_cnt++;
     165        options.clopts.instance = &this.self;
    167166}
    168167
     
    268267                        Acceptor * acceptors = 0p;
    269268                        Q * queues = 0p;
    270                         ServerCluster cl[options.clopts.nclusters];
     269                        ServerCluster cl;
    271270
    272271                        init_protocol();
     
    320319                                        }
    321320                                }
    322                                 cl[0].prnt->conns = conns;
    323                                 cl[0].prnt->conn_cnt = options.clopts.nworkers;
    324                                 sout | options.clopts.nworkers | "workers started on" | options.clopts.nprocs | "processors /" | options.clopts.nclusters | "clusters";
    325                                 for(i; options.clopts.nclusters) {
    326                                         sout | options.clopts.thrd_cnt[i] | nonl;
    327                                 }
     321                                cl.prnt->conns = conns;
     322                                cl.prnt->conn_cnt = options.clopts.nworkers;
     323                                sout | options.clopts.nworkers | "workers started on" | options.clopts.nprocs | "processors";
    328324                                sout | nl;
    329325                                {
     
    440436
    441437                        sout | "Stopping printer threads..." | nonl; flush( sout );
    442                         for(i; options.clopts.nclusters) {
    443                                 StatsPrinter * p = cl[i].prnt;
    444                                 if(p) {
    445                                         notify_one(p->var);
    446                                         join(*p);
    447                                 }
     438                        StatsPrinter * p = cl.prnt;
     439                        if(p) {
     440                                notify_one(p->var);
     441                                join(*p);
    448442                        }
    449443                        sout | "done";
  • benchmark/io/http/options.cfa

    rbbf61838 r8c58e73  
    4242
    4343        { // cluster
    44                 1,     // nclusters;
    4544                1,     // nprocs;
    4645                1,     // nworkers;
     
    5352
    5453void parse_options( int argc, char * argv[] ) {
    55         // bool fixedfd = false;
    56         // bool sqkpoll = false;
    57         // bool iokpoll = false;
    5854        unsigned nentries = 0;
    59         bool isolate = false;
    60 
    61 
    6255        static cfa_option opt[] = {
    6356                { 'p', "port",           "Port the server will listen on", options.socket.port},
    6457                { 'c', "cpus",           "Number of processors to use", options.clopts.nprocs},
    6558                { 't', "threads",        "Number of worker threads to use", options.clopts.nworkers},
    66                 {'\0', "isolate",        "Create one cluster per processor", isolate, parse_settrue},
    6759                {'\0', "log",            "Enable logs", options.log, parse_settrue},
    6860                {'\0', "sout",           "Redirect standard out to file", options.reopen_stdout},
     
    9991                nentries = v;
    10092        }
    101         if(isolate) {
    102                 options.clopts.nclusters = options.clopts.nprocs;
    103                 options.clopts.nprocs = 1;
    104         }
    10593        options.clopts.params.num_entries = nentries;
    106         options.clopts.instance = alloc(options.clopts.nclusters);
    107         options.clopts.thrd_cnt = alloc(options.clopts.nclusters);
    108         options.clopts.cltr_cnt = 0;
    109         for(i; options.clopts.nclusters) {
    110                 options.clopts.thrd_cnt[i] = 0;
    111         }
     94        options.clopts.instance = 0p;
     95        options.clopts.thrd_cnt = 0;
    11296
    11397
  • benchmark/io/http/options.hfa

    rbbf61838 r8c58e73  
    3131
    3232        struct {
    33                 int nclusters;
    3433                int nprocs;
    3534                int nworkers;
     
    3736                bool procstats;
    3837                bool viewhalts;
    39                 cluster ** instance;
    40                 size_t   * thrd_cnt;
    41                 size_t     cltr_cnt;
     38                cluster * instance;
     39                size_t    thrd_cnt;
    4240        } clopts;
    4341};
  • benchmark/io/http/worker.cfa

    rbbf61838 r8c58e73  
    117117//=============================================================================================
    118118void ?{}( AcceptWorker & this ) {
    119         size_t cli = rand() % options.clopts.cltr_cnt;
    120         ((thread&)this){ "Server Worker Thread", *options.clopts.instance[cli], 64000 };
    121         options.clopts.thrd_cnt[cli]++;
     119        ((thread&)this){ "Server Worker Thread", *options.clopts.instance, 64000 };
     120        options.clopts.thrd_cnt++;
    122121        this.done = false;
    123122}
     
    151150//=============================================================================================
    152151void ?{}( ChannelWorker & this ) {
    153         size_t cli = rand() % options.clopts.cltr_cnt;
    154         ((thread&)this){ "Server Worker Thread", *options.clopts.instance[cli], 64000 };
    155         options.clopts.thrd_cnt[cli]++;
     152        ((thread&)this){ "Server Worker Thread", *options.clopts.instance, 64000 };
     153        options.clopts.thrd_cnt++;
    156154        this.done = false;
    157155}
     
    182180
    183181void ?{}( Acceptor & this ) {
    184         size_t cli = rand() % options.clopts.cltr_cnt;
    185         ((thread&)this){ "Server Worker Thread", *options.clopts.instance[cli], 64000 };
    186         options.clopts.thrd_cnt[cli]++;
     182        ((thread&)this){ "Server Worker Thread", *options.clopts.instance, 64000 };
     183        options.clopts.thrd_cnt++;
    187184        this.done = false;
    188185}
Note: See TracChangeset for help on using the changeset viewer.