Message70577
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() |
|
Date |
User |
Action |
Args |
2008-08-01 17:54:12 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, mark.dickinson, jnoller |
2008-08-01 17:54:12 | amaury.forgeotdarc | set | messageid: <1217613252.03.0.631800079732.issue3399@psf.upfronthosting.co.za> |
2008-08-01 17:54:11 | amaury.forgeotdarc | link | issue3399 messages |
2008-08-01 17:54:11 | amaury.forgeotdarc | create | |
|