Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db276591 authored by Alice Ryhl's avatar Alice Ryhl Committed by Automerger Merge Worker
Browse files

Merge changes I66d15781,I4568eb55 into main am: fdd6df04

parents 2d2fa61b fdd6df04
Loading
Loading
Loading
Loading
+32 −20
Original line number Diff line number Diff line
@@ -220,11 +220,15 @@ void worker_fx(int num,
        workers.push_back(serviceMgr->waitForService(generateServiceName(i)));
    }

    // Run the benchmark if client
    ProcResults results(iterations);
    p.signal();
    p.wait();

    ProcResults results(iterations);
    chrono::time_point<chrono::high_resolution_clock> start, end;
    for (int i = 0; (!cs_pair || num >= server_count) && i < iterations; i++) {

    // Skip the benchmark if server of a cs_pair.
    if (!(cs_pair && num < server_count)) {
        for (int i = 0; i < iterations; i++) {
            Parcel data, reply;
            int target = cs_pair ? num % server_count : rand() % workers.size();
            int sz = payload_size;
@@ -245,6 +249,7 @@ void worker_fx(int num,
               exit(EXIT_FAILURE);
            }
        }
    }

    // Signal completion to master and wait.
    p.signal();
@@ -300,8 +305,15 @@ void run_main(int iterations,
        pipes.push_back(make_worker(i, iterations, workers, payload_size, cs_pair));
    }
    wait_all(pipes);
    // All workers have now been spawned and added themselves to service
    // manager. Signal each worker to obtain a handle to the server workers from
    // servicemanager.
    signal_all(pipes);
    // Wait for each worker to finish obtaining a handle to all server workers
    // from servicemanager.
    wait_all(pipes);

    // Run the workers and wait for completion.
    // Run the benchmark and wait for completion.
    chrono::time_point<chrono::high_resolution_clock> start, end;
    cout << "waiting for workers to complete" << endl;
    start = chrono::high_resolution_clock::now();