Skip to content

Commit 60a9051

Browse files
Carlos LlamasDarksonn
authored andcommitted
binderThroughputTest: gather servers right away
Start gathering servers upon worker creation. Don't wait until signaled by test. This should allow all clients to start transactions at a better coordinated time. Change-Id: I4568eb55fc9ce18839c1e5592a722a0284987745 Test: Ran a benchmark on cuttlefish, and it did not get stuck Signed-off-by: Carlos Llamas <cmllamas@google.com> Co-developed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
1 parent 14b243b commit 60a9051

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

libs/binder/tests/binderThroughputTest.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ void worker_fx(int num,
220220
workers.push_back(serviceMgr->waitForService(generateServiceName(i)));
221221
}
222222

223+
p.signal();
224+
p.wait();
225+
223226
// Run the benchmark if client
224227
ProcResults results(iterations);
225228

@@ -300,8 +303,15 @@ void run_main(int iterations,
300303
pipes.push_back(make_worker(i, iterations, workers, payload_size, cs_pair));
301304
}
302305
wait_all(pipes);
306+
// All workers have now been spawned and added themselves to service
307+
// manager. Signal each worker to obtain a handle to the server workers from
308+
// servicemanager.
309+
signal_all(pipes);
310+
// Wait for each worker to finish obtaining a handle to all server workers
311+
// from servicemanager.
312+
wait_all(pipes);
303313

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

0 commit comments

Comments
 (0)