<story><title>Composable multi-threaded parallelism in Julia</title><url>https://julialang.org/blog/2019/07/multithreading</url></story><parent_chain><item><author>StefanKarpinski</author><text>It&amp;#x27;s hard to overstate what a big deal this is (and how much effort went into it). The only mainstream languages with this kind of composable parallelism are Go and Erlang, both of which target writing servers, rather than high-performance computing, and which therefore optimize for I&amp;#x2F;O throughput rather than CPU throughput.&lt;p&gt;The only systems which have supported compute-oriented composable parallelism like this are Cilk and TBB, which are both really excellent and successful—and provided major inspiration for this work. However, they both seem to have fallen short of widespread adoption partly due to being non-free (until recently) and also, I suspect, because they are non-standard C&amp;#x2F;C++ language&amp;#x2F;compiler extensions, which seem to never catch on that broadly.&lt;p&gt;This is a brave new world for high-performance technical computing, not just for Julia.</text></item></parent_chain><comment><author>pka</author><text>For completeness&amp;#x27; sake, Haskell has had this for over a decade :) A SO thread that gives a nice overview [0], the paper [1], the library [2]. Here&amp;#x27;s how a parallel fib looks like:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  fib :: Int -&amp;gt; Int
  fib n
    | n &amp;lt;= 1    = 1
    | otherwise = x ‘par‘ (y ‘pseq‘ x + y + 1)
    where
      x = fib (n-1)
      y = fib (n-2)
&lt;/code&gt;&lt;/pre&gt;
[0] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;stackoverflow.com&amp;#x2F;questions&amp;#x2F;958449&amp;#x2F;what-is-a-spark-in-haskell&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;stackoverflow.com&amp;#x2F;questions&amp;#x2F;958449&amp;#x2F;what-is-a-spark-i...&lt;/a&gt;&lt;p&gt;[1] &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;simonmar.github.io&amp;#x2F;bib&amp;#x2F;papers&amp;#x2F;strategies.pdf&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;simonmar.github.io&amp;#x2F;bib&amp;#x2F;papers&amp;#x2F;strategies.pdf&lt;/a&gt;&lt;p&gt;[2] &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;hackage.haskell.org&amp;#x2F;package&amp;#x2F;parallel-3.2.2.0&amp;#x2F;docs&amp;#x2F;Control-Parallel.html&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;hackage.haskell.org&amp;#x2F;package&amp;#x2F;parallel-3.2.2.0&amp;#x2F;docs&amp;#x2F;Con...&lt;/a&gt;</text></comment>
<story><title>Composable multi-threaded parallelism in Julia</title><url>https://julialang.org/blog/2019/07/multithreading</url></story><parent_chain><item><author>StefanKarpinski</author><text>It&amp;#x27;s hard to overstate what a big deal this is (and how much effort went into it). The only mainstream languages with this kind of composable parallelism are Go and Erlang, both of which target writing servers, rather than high-performance computing, and which therefore optimize for I&amp;#x2F;O throughput rather than CPU throughput.&lt;p&gt;The only systems which have supported compute-oriented composable parallelism like this are Cilk and TBB, which are both really excellent and successful—and provided major inspiration for this work. However, they both seem to have fallen short of widespread adoption partly due to being non-free (until recently) and also, I suspect, because they are non-standard C&amp;#x2F;C++ language&amp;#x2F;compiler extensions, which seem to never catch on that broadly.&lt;p&gt;This is a brave new world for high-performance technical computing, not just for Julia.</text></item></parent_chain><comment><author>thekhatribharat</author><text>&amp;gt; &lt;i&gt;this kind of composable parallelism are Go and Erlang,&lt;/i&gt; ... &lt;i&gt;which therefore optimize for I&amp;#x2F;O throughput rather than CPU throughput&lt;/i&gt;&lt;p&gt;Parallelism is always for CPU throughput, precisely why you don&amp;#x27;t run any more OS threads than the number of cores.&lt;p&gt;Concurrency primitives (whether in Go, Erlang or any other programming language) are meant for I&amp;#x2F;O-bound tasks. Let&amp;#x27;s not conflate concurrency primitives enabling I&amp;#x2F;O-bound tasks and parallelism primitives enabling CPU-bound tasks.</text></comment>