MCPcopy Create free account
hub / github.com/apache/brpc / launch_many_bthreads

Function launch_many_bthreads

test/bthread_key_unittest.cpp:454–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454static void launch_many_bthreads(PoolData2* data) {
455 std::vector<bthread_t> tids;
456 tids.reserve(25000);
457 for (size_t i = 0; i < 25000; ++i) {
458 bthread_t t0;
459 PoolData2* data_tmp = new PoolData2();
460 data_tmp->key = data->key;
461 ASSERT_EQ(0, bthread_start_background(&t0, &(data->attr), usleep_thread, data_tmp));
462 tids.push_back(t0);
463 }
464
465 usleep(3 * 1000 * 1000L);
466 for (size_t i = 0; i < tids.size(); ++i) {
467 bthread_join(tids[i], NULL);
468 }
469}
470
471static void* run_launch_many_bthreads(void* args) {
472 PoolData2* data = (PoolData2*)args;

Callers 1

run_launch_many_bthreadsFunction · 0.70

Calls 5

bthread_start_backgroundFunction · 0.85
bthread_joinFunction · 0.85
reserveMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected