In short, say I have the following:
import multiprocessing
class Worker(multiprocessing.Process):
def __init__(self):
multiprocessing.Process.__init__(self)
print "Init"
self.value = None
def run(self):
print "Running"
self.value = 1
p = Worker()
p.start()
p.join()
print p.value
I'd expect the output to be:
Init
Running
1
Instead it is
Init
Running
None
Can someone explain to me why this is the case? What am I not understanding, and how should I go about doing it correctly?
Thanks.