<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Answering myself, you can tell I'm a multiprocessing newbie:<br>
</p>
<br>
<div class="moz-cite-prefix">On 07/09/2016 14:49, Chris Withers
wrote:<br>
</div>
<blockquote
cite="mid:2c753f88-845d-3a80-3c21-6e7a507295d5@simplistix.co.uk"
type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<p>Hi Ned,</p>
<p>I hope so!</p>
<p>The core of my mp code is:</p>
<p>
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
</p>
<pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:9.0pt;">pool = Pool(<span style="color:#660099;">processes</span>=processes, <span style="color:#660099;">initializer</span>=init)
result = pool.imap_unordered(func, iterable)
started = datetime.now()
<span style="color:#000080;font-weight:bold;">try</span>:
<span style="color:#000080;font-weight:bold;">if </span>progress:
i = show_progress(started, result)
<span style="color:#000080;font-weight:bold;">else</span>:
<span style="color:#000080;font-weight:bold;">for </span>i, _ <span style="color:#000080;font-weight:bold;">in </span><span style="color:#000080;">enumerate</span>(result): <span style="color:#000080;font-weight:bold;">pass
</span><span style="color:#000080;font-weight:bold;">finally</span>:
pool.terminate()
pool.join()
</pre>
Does that look write/wrong?<br>
</blockquote>
Yes, should be .close() instead of .terminate()!<br>
<br>
Chris<br>
</body>
</html>