Here is a reproducible code:
from multiprocessing import Process, Manager
manager = Manager()
shared_results_dict = manager.dict()
class WorkerProcess(Process):
def __init__(self, shared_results_dict):
super(WorkerProcess, self).__init__()
self.shared_results_dict = shared_results_dict
def run(self):
self.shared_results_dict['a'] = 3
subproc = WorkerProcess(shared_results_dict)
subproc.daemon = True
subproc.start()
shared_results_dict['a']
The code above works fine when the start method for the multiprocessing is set as fork, but it fails to work when it is set to either forkserver or spawn. I thought Manager should work with whatever start method I use?