<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>There's also RabbitMQ's worker_pool, <a href="http://www.lshift.net/blog/2010/03/29/on-the-limits-of-concurrency-worker-pools-in-erlang">http://www.lshift.net/blog/2010/03/29/on-the-limits-of-concurrency-worker-pools-in-erlang</a>,  and my feeble attempt at somewhat extending it: <a href="https://github.com/dmitriid/worker_pool">https://github.com/dmitriid/worker_pool</a></div><br class="Apple-interchange-newline"><blockquote type="cite"><div>-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br>For a work project I have a large list (thousands of items) to process<br>and at first built a "pmap" implementation as per Joe's book until I<br>found the plists module (which is awesome btw).<br><br>There is one glaring issue with the list -> subdivide -> spawn x<br>processes for n sublist items strategy; if an item in the sublist takes<br>longer than all the other items it blocks the entire resource allotment<br>until it is done.<br><br>In most cases, the plists/pmap implementation works just fine because<br>the items in the list probably don't take more than a few milliseconds<br>to map the fun over. However, it does become an issue when that is not<br>the case.<br><br>So, I figured the next best strategy would be to implement a process<br>pool since it would allow for slow running processes to continue their<br>work while finished processes can die and new processes spawned into the<br>pool ready for work - so none of the resources are sitting idle.<br><br>Right now, my module isn't nearly as feature-complete as the plists<br>module is - this is only a drop in replacement for map. Please submit<br>your criticisms and comments to me at this address.<br><br>You may find the code on BitBucket: <a href="https://bitbucket.org/ixmatus/ppool">https://bitbucket.org/ixmatus/ppool</a><br><br>- -- <br>Parnell "ixmatus" Springmeyer (<a href="http://ixmat.us">http://ixmat.us</a>)<br>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG/MacGPG2 v2.0.17 (Darwin)<br>Comment: GPGTools - <a href="http://gpgtools.org">http://gpgtools.org</a><br><br>iQEcBAEBAgAGBQJOJmKwAAoJEPvtlbpI1POL+asIAKPcR0SOw67hFwwIbmkf89sS<br>4+Zx9hx1V/+86OVtXcqcOY+yxNcHezNEKkw8z2XHmDAWbeOl3bbINFySRXbQVydV<br>854lArqCHRG+ZlJ6ZrgecXKf9mG8ldbK1InwEZWOVZBj63rhmloMaGiyTzmxA88S<br>7mDNS4uhhpvRT2znpnsWt1x12IAzeayV0hf5/BLjp+b5FMZPc9oSa4n5uzyA9AVW<br>+av6hyuFfK32lhxUb4u3bVMaHOf2n/YwJexS25+NODcpkI3BLXNkrmKwgz8Lv/sA<br>omKzKTiuhpa0vTM+TLI9pn82GCJLdD+ON9DDOFN4ww+BnmXjhykiicBQCg7yhtQ=<br>=GP7K<br>-----END PGP SIGNATURE-----<br>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; ">===================================</span></font></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; ">Dmitrii Dimandt<br><a href="mailto:dmitrii@dmitriid.com">dmitrii@dmitriid.com</a><br><br></span></font></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; ">------------------------------------------------------------<br>Erlang in Russian<br><a href="http://erlanger.ru/">http://erlanger.ru/</a></span></font><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; "><br></span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; ">TurkeyTPS</span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; "><a href="http://turkeytps.com/">http://turkeytps.com/</a></span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; ">------------------------------------------------------------</span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; "><br></span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; ">LinkedIn: <a href="http://www.linkedin.com/in/dmitriid">http://www.linkedin.com/in/dmitriid</a></span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; ">GitHub: <a href="https://github.com/dmitriid">https://github.com/dmitriid</a></span></font></div><div><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; "><br></span></font></div></div></span></div></span><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; "><br class="Apple-interchange-newline"></span></font></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></body></html>