I have a code which looks like following:
import some_module
def foo(f):
//do something
some_module.func()
jobs = [mp.Process(target=foo, args=(f,)) for f in files]
for job in jobs:
job.start()
for job in jobs:
job.join()
So, each process spawned has its own copy of foo
function but all the processes try to access the same copy of the function some_module.func()
My requirement is that each process have separate copy of foo
and some_module.func()
so that one process does not hinder progress of another process.