import multiprocessing
def test(d):
a = {}
for i in range(10):
a[i] = i +1
print(a)
d = a
if __name__ == "__main__":
manager = multiprocessing.Manager()
d = manager.dict()
p = multiprocessing.Process(target = test, args = (d, ))
p.start()
p.join()
print(d)
I try to create a dictionary in def test(d)
with multiprocessing manager.
Why is a
the desired dict, but d
is an empty dict, although d = a
?