Message70577
| 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: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 |
|