<html><body bgcolor="#FFFFFF"><div>Hello,</div><div><br></div><div>Here's a belated answer to your question (hectic times prevented me from tending to non-urgent email).</div><div><br></div><div>I think a parallel library would be great to have as indeed phobos is geared at general concurrency. Such a lib would also expose bugs and weaknesses in our model and its implementation.&nbsp;</div><div><br></div><div>Andrei<br><br>Sent by shouting through my showerhead.</div><div><br>On May 30, 2010, at 12:54 PM, David Simcha &lt;<a href="mailto:dsimcha@gmail.com">dsimcha@gmail.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>I have a few questions/comments about the possible inclusion of a library for parallelism in Phobos:<br><br>1.&nbsp; What is the status of std.concurrency?&nbsp; It's in the source tree, but it's not in the documentation or the changelogs.&nbsp; It appears to have been checked in quietly ~3 months ago, and I just noticed now.<br>
<br>2.&nbsp; From reading the description of std.concurrency in TDPL it seemed more geared toward concurrency (i.e. making stuff appear to be happening simultaneously, useful for things like GUIs and servers) rather than parallelism (i.e. the use of multiple CPU cores to increase throughput, useful for things like scientific computing and video encoding).&nbsp; It seems fairly difficult (though I haven't tried yet) to write code that's designed for pull-out-all-stops maximal performance on a multicore machine, especially since immutability is somewhat of a straight jacket.&nbsp; I find implicit sharing and the use of small synchronized blocks or atomic ops to be very useful in writing parallel programs.<br>
<br>3.&nbsp; Most code where parallelism, as opposed to concurrency, is the goal (at least most that I write) is parallelized in one or two small, performance critical sections, and the rest is written serially.&nbsp; Therefore, it's easy to reason about things and safety isn't as important as the case of concurrency-oriented multithreading over large sections of code.<br>
<br>4.&nbsp; I've been eating my own dogfood for awhile on my ParallelFuture library.&nbsp; (<a href="http://cis.jhu.edu/~dsimcha/parallelFuture.html"><a href="http://cis.jhu.edu/~dsimcha/parallelFuture.html">http://cis.jhu.edu/~dsimcha/parallelFuture.html</a></a>; <a href="http://dsource.org/projects/scrapple/browser/trunk/parallelFuture/parallelFuture.d"><a href="http://dsource.org/projects/scrapple/browser/trunk/parallelFuture/parallelFuture.d">http://dsource.org/projects/scrapple/browser/trunk/parallelFuture/parallelFuture.d</a></a>)&nbsp; It's geared toward throughput-oriented parallelism on multicore machines, not concurrency for GUIs, servers, etc. and is higher level than std.concurrency.&nbsp; Is there any interest in including something like this in Phobos?&nbsp; If so, would we try to make it fit into the explicit-sharing-only model, or treat it as an alternative method of multithreading geared towards pull-out-all-stops parallelism on multicore computers?<br>
<br>One last note:&nbsp; Walter claimed a while back on the NG that Parallelfuture doesn't compile.&nbsp; I use it regularly and it compiles for me.&nbsp; Walter, can you please point out what the issue was?<br>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>phobos mailing list</span><br><span><a href="mailto:phobos@puremagic.com">phobos@puremagic.com</a></span><br><span><a href="http://lists.puremagic.com/mailman/listinfo/phobos">http://lists.puremagic.com/mailman/listinfo/phobos</a></span></div></blockquote></body></html>