MCPcopy Create free account
hub / github.com/apache/impala / ImpalaThreadStarter

Function ImpalaThreadStarter

be/src/benchmarks/thread-create-benchmark.cc:89–101  ·  view source on GitHub ↗

Runs N Impala Threads, each executing 'f'

Source from the content-addressed store, hash-verified

87
88// Runs N Impala Threads, each executing 'f'
89void ImpalaThreadStarter(int num_threads, const function<void ()>& f) {
90 vector<unique_ptr<Thread>> threads;
91 threads.reserve(num_threads);
92 for (int i=0; i < num_threads; ++i) {
93 unique_ptr<Thread> thread;
94 Status s = Thread::Create("mythreadgroup", "thread", f, &thread);
95 DCHECK(s.ok());
96 threads.push_back(move(thread));
97 }
98 for (unique_ptr<Thread>& thread: threads) {
99 thread->Join();
100 }
101}
102
103// Times how long it takes to run num_threads 'executors', each of
104// which spawns num_threads_per_executor empty threads, and to wait

Callers 1

TimeParallelExecutorsFunction · 0.70

Calls 6

CreateClass · 0.85
moveFunction · 0.85
reserveMethod · 0.80
push_backMethod · 0.80
okMethod · 0.45
JoinMethod · 0.45

Tested by

no test coverage detected