<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>We use OS processes rather than threads. We're running Perl on Windows, and although it can emulate fork(), the price is a significant performance hit, and little architectural advantage. </div><div><br></div><div>We do handle scalability through a task management framework, which essentially wraps different types of OS processes into a model where processes can be started in parallel, and where the manager waits until all have been completed before continuing. We can nest parallel and sequential blocks. (I used the communicating sequential processes model as a base for this.) Data can be shared between them - I used the ludicrously simple approach of a SQLite database with exclusive transactions to coordinate, and the file system to share large amounts of data. It's worth stating that this task management framework is different from both UNIX and Windows, as well as Perl, in particular trying to make processes that split join again effectively. </div><div><br></div><div>Some of this was driven by other reasons than threading in Perl. Our system can be very memory-hungry, and Windows Perl's were not 64-bit friendly at the time, so we had around 1.4Gb limit on memory for the process, including all threads. This was too low, and a second reason for using OS processes was to spread the memory load. A fair number of our processes are also written in Java, so we'd need to cross language boundaries too. </div><div><br></div><div>Others may correct me: it seemed to me that Perl threading evolved towards a model that could provide a fork() emulation for Windows. While fork emulation for Windows might be useful, I can live without it. I'd rather have had very light (no memory copying, use at your own risk) OS threads in Perl, which would actually have been more useful in cases where we needed to spread CPU load. And I'm not sure that adding threading with a significant performance hit is a reasonable tradeoff. Threading shouldn't affect the performance of code that doesn't do threading stuff.</div><div><br></div><div>Ours is a web application, and we did consider threading for the front-end, handling requests in Catalyst, which would be a a very good application for prefork-style parallelism. Unfortunately, on Windows, we were using FastCGI, which will never forward more than a single request to a helper process at a time, so in practice, there would be no performance advantage to threading, just the same performance hit.</div><div><br></div><div>To conclude, on a Windows Perl at least, the main advantage of threading is it gives you fork, and that helps CPAN tests pass better. The price is reduced performance across the board, and we'd have had to use OS processes anyway because the 32-bit memory limits were too low. So we built a non-threaded Windows Perl and went with that and a home-brewed task coordination ad management component. </div><div><br></div>--S<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; "><div><font class="Apple-style-span" color="#9F001C">--</font></div><div><font class="Apple-style-span" color="#9F001C">Stuart Watt</font></div><div><font class="Apple-style-span" color="#9F001C"><a href="mailto:stuart@morungos.com">stuart@morungos.com</a></font></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On 2010-12-11, at 2:29 PM, <a href="mailto:arocker@vex.net">arocker@vex.net</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>In order not to embarrass myself (or Perl) at the GTALUG meeting on<br>Tuesday, I'm researching the agenda. and I need help with this item:<br><br>* How does your language handle scalability issues?<br> * Applications that require many concurrent threads of execution?<br> * How does the language interact with threading?<br> * Does it offer other models for managing concurrent processing?<br><br>I've never had to deal with multiple concurrent processes, and frankly<br>take a dim view of applications trying to do the OS's job for it. Has<br>anybody any experience in this area that I can quote?<br><br>_______________________________________________<br>toronto-pm mailing list<br><a href="mailto:toronto-pm@pm.org">toronto-pm@pm.org</a><br>http://mail.pm.org/mailman/listinfo/toronto-pm<br></div></blockquote></div><br></body></html>