Skip to content Skip to sidebar Skip to footer

Multiple Process Is Not Getting Created Python

I am working on task where I am creating multiple process to run code in parallel to speed up process. below is my code. def update_value(value): print('module name:\n', __name

Solution 1:

After doing some more searches over the topic I found that the process does a fork() followed by an execve() of a completely new Python process. That solved problem, because module state starts from scratch. In code as below.

if __name__ == '__main__':
    with get_context("spawn").Pool(2) as pool:
        pool.map(update_value, ValueList)

Hope this helps


Post a Comment for "Multiple Process Is Not Getting Created Python"