0

I use linux for most of my development purposes, but from time to time I have to develop something for Windows.

This time I had to build something in Python that takes advantage of all cores available in system.

I choose multiprocessing library to achieve this since it works just as In need it in linux, but, in Windows I've encountered with very weird issue - the process I create does not "know" the function I set as target:

import multiprocessing
def foo():
    print 'starting' multiprocessing.current_process().name
    print 'exiting' multiprocessinf.current_process().name

p = multiprocessing.Process(name = 'Test', target = foo)
p.start()

And I get exception:

Module object has no attribute foo.

I've done exactly the same in Linux and it works just as expected. Then I'm asking here, why it happens, and how to fix it.

Best regards, Chuyag.

0 Answers0