This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, jnoller, mark.dickinson
Date 2008-08-01.17:54:11
SpamBayes Score 0.014970995
Marked as misclassified No
Message-id <1217613252.03.0.631800079732.issue3399@psf.upfronthosting.co.za>
In-reply-to
Content
Mark,
There are 3 semicolons missing in your patch, in pipe_connection.c, just
after the calls to WriteFile and ReadFile.
After this, it compiles and runs correctly. Tests pass.

Note that on Windows, your "nine lines" cannot work as is, because the
processes are spawned, not forked: the sqr() function is not copied.
And if you save the lines in a script file, it will be imported by every
subprocess, and every subprocess will start its own manager... and
memory explodes.

import multiprocessing.managers
def sqr(x): return x*x
if __name__ == '__main__':
    manager = multiprocessing.managers.SyncManager()
    manager.start()
    pool = manager.Pool(4)
    it = pool.imap_unordered(sqr, range(1000))
    assert sorted(it) == [sqr(x) for x in range(1000)]
    pool.terminate()
    manager.shutdown()
History
Date User Action Args
2008-08-01 17:54:12amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, mark.dickinson, jnoller
2008-08-01 17:54:12amaury.forgeotdarcsetmessageid: <1217613252.03.0.631800079732.issue3399@psf.upfronthosting.co.za>
2008-08-01 17:54:11amaury.forgeotdarclinkissue3399 messages
2008-08-01 17:54:11amaury.forgeotdarccreate