I can't find any reference to this question and it seems so trivial.
Is it even possible to share objects across Pythons workers from multiprocessing Pool
?
Here's a little example:
from multiprocessing import Pool
def work(a):
return do_work(obj_b)
def main(obj_a, obj_b):
my_iterable = get_iter(obj_a)
p = Pool(processes=6)
res = p.map(work, my_iterable)
Lets say get_iter(obj_a) returns an iterable object.
How does "work"
know of obj_b?