【发布时间】:2020-09-25 15:07:15
【问题描述】:
我是 Python 新手。我正在尝试做某事,但不确定是否可行。 我想创建一个运行 1 个函数的线程,然后运行另一个函数。
例如
thread.start_new_thread( func1 )
//Run this thread only after the first one was finished
thread.start_new_thread( func2 )
可以用 1 个线程来完成吗?或者我需要创建 2 个线程? 我该怎么办?
【问题讨论】:
-
您的意思是:
def func3(): func1();func2()? -
我的意思是创建一个线程实例。使用这个实例运行两个函数,一个接一个。
标签: python multithreading thread-safety threadpool