【发布时间】:2016-12-11 12:02:49
【问题描述】:
我有一个类似这样的代码,
import threading
class Mythread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
print('do some processing')
if __name__=='__main__':
while Ture:
val = raw_input('next thread')
t = MyThread()
t.start()
t.join()
问题是我怎样才能在不阻塞主函数的情况下继续主函数,因为t.join() 停止主函数直到 t 没有完成?
【问题讨论】:
标签: multithreading python-3.x return python-multithreading