有人可以解释为什么此代码在同一线程但在不同进程上执行吗?那怎么可能?
from concurrent.futures import ProcessPoolExecutor
import os
import threading
def whereami():
print("You are on thread {} and on process {}".format(
threading.get_ident(), os.getpid()))
with ProcessPoolExecutor() as pool:
whereami()
pool.submit(whereami)