mrhhsg commented on code in PR #9193: URL: https://github.com/apache/incubator-doris/pull/9193#discussion_r858548631
########## be/src/vec/exec/join/vhash_join_node.cpp: ########## @@ -636,6 +653,58 @@ struct ProcessHashTableProbe { ProfileCounter* _probe_side_output_timer; }; +class ProbeThreadPool { +public: + typedef std::function<void(int thread_id)> WorkFunction; + struct Task { + public: + WorkFunction work_function; + }; + + ProbeThreadPool(uint32_t num_threads, uint32_t queue_size) + : _work_queue(queue_size), _shutdown(false) { + for (int i = 0; i < num_threads; ++i) { + _threads.create_thread( + std::bind<void>(std::mem_fn(&ProbeThreadPool::work_thread), this, i)); + } + } + + ~ProbeThreadPool() { + shutdown(); + join(); + } + + bool offer(Task task) { return _work_queue.blocking_put(task); } + + void shutdown() { + _shutdown = true; + _work_queue.shutdown(); + } + + virtual void join() { _threads.join_all(); } Review Comment: Yes, I will remove it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org