草庐IT

ProcessPoolExecuter

全部标签

python - 为什么在使用 concurrent.futures.ProcessPoolExecuter() 进行多处理期间不止一次打印此消息?

“我应该只出现一次”这句话应该只出现一次。我无法理解为什么它又出现了3次...我很清楚我的代码正在执行3个进一步的进程。但是在这3个进程中,只有funktion0()被调用。为什么声明“我应该只出现一次”包含在这额外的3个进程中?有人可以解释一下吗?代码:fromdatetimeimportdatetime#print(datetime.now().time())fromtimeimporttime,sleep#print(time())print("Ishouldappearonlyonce")fromconcurrentimportfuturesdeffunktion0(arg0)