I've got two functions that I call in a thread each passing in the same dictionary that they add to. I also have a third function that runs outside of the thread after both the threaded functions finish that also adds items into the dictionary.
When I check the contents of the dictionary, it only contains the contents of the third function. An example of what I'm talking about is below:
from multiprocessing import Process, Pipe
my_dict = {}
process1 = Process(target=class1.run, args=(my_dict,))
process2 = Process(target=class2.run, args=(my_dict,))
process1.start()
process2.start()
process1.join()
process2.join()
class3.run(my_dict)
print(my_dict)
What's the workaround to allow me to pass the dictionary to each function (threaded or not) and ensure all values are inserted?