I am struggling to understand the difference between run()
and start()
. According to the documentation, run()
method invokes the calla
You are not supposed to call process.run()
explicitly. It's the method which invokes your specified target
function unless you override it when you subclass Process
. It normally gets called within the new child while it bootstraps. It does nothing else than calling the target function.
# multiprocessing.process.BaseProcess
def run(self):
'''
Method to be run in sub-process; can be overridden in sub-class
'''
if self._target:
self._target(*self._args, **self._kwargs)
When you call it in your parent process, it gets executed in your parent process like any other method.
process.start()
is the method which you're supposed to call in your parent to create the new process in the first place.