# When this program is run on windows using python 3.9.9 it crashes about 50% # of the time. import _testcapi import threading code = """ import importlib.util """ def doIt(): _testcapi.run_in_subinterp(code) tt=[] for i in range(16): t = threading.Thread(target=doIt) t.start() tt.append(t) for t in tt: t.join()