Runs N Impala Threads, each executing 'f'
| 87 | |
| 88 | // Runs N Impala Threads, each executing 'f' |
| 89 | void 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 |