Commit 87ef4618 authored by lizhigong's avatar lizhigong
Browse files

过滤重复创建thread

parent 1a906ab9
...@@ -53,9 +53,11 @@ class TwoBatchOverlap(): ...@@ -53,9 +53,11 @@ class TwoBatchOverlap():
def init_tbo_thread(self): def init_tbo_thread(self):
self.model_input_left_queue.empty() self.model_input_left_queue.empty()
self.model_input_right_queue.empty() self.model_input_right_queue.empty()
if self.left_thread == None:
self.left_thread = threading.Thread(target=self.thread_two_batch_overlap, args=(self.model_input_left_queue,)) self.left_thread = threading.Thread(target=self.thread_two_batch_overlap, args=(self.model_input_left_queue,))
self.right_thread = threading.Thread(target=self.thread_two_batch_overlap, args=(self.model_input_right_queue,))
self.left_thread.start() self.left_thread.start()
if self.right_thread == None:
self.right_thread = threading.Thread(target=self.thread_two_batch_overlap, args=(self.model_input_right_queue,))
self.right_thread.start() self.right_thread.start()
logger.info('tbo:two batch overlap threads start') logger.info('tbo:two batch overlap threads start')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment