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

Function ImpalaThreadStarter

be/src/benchmarks/process-wide-locks-benchmark.cc:108–125  ·  view source on GitHub ↗

Runs 'num_threads' Impala Threads and have each of them execute func().

Source from the content-addressed store, hash-verified

106
107// Runs 'num_threads' Impala Threads and have each of them execute func().
108void ImpalaThreadStarter(void (*func) (const TUniqueId&, int), int num_threads,
109 int func_arg) {
110 vector<unique_ptr<Thread>> threads;
111 threads.reserve(num_threads);
112
113 for (int i=0; i < num_threads; ++i) {
114 unique_ptr<Thread> thread;
115 function<void ()> f =
116 bind(func, query_ids[i], func_arg);
117 Status s =
118 Thread::Create("mythreadgroup", "thread", f, &thread);
119 DCHECK(s.ok());
120 threads.push_back(move(thread));
121 }
122 for (unique_ptr<Thread>& thread: threads) {
123 thread->Join();
124 }
125}
126
127void RunBenchmark(int num_queries, int num_accesses) {
128 StopWatch total_time;

Callers 1

RunBenchmarkFunction · 0.70

Calls 7

bindFunction · 0.85
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