Composable multi-threaded parallelism in Julia
Maybe I misunderstand, but: In R allocating and copying huge return vectors for small changes on input vectors ruins performance. My understanding of Julia was that one advantage over R is the possiblity to mutate input vectors in place. Referring to the psort! example for Julia&#x27;s multithreading I wonder why &quot;We simply need to allocate one initially-empty array <i>per thread</i>&quot; which to me looks like allocating huge vectors for small changes down the call recursion (and wastes memory by the number of threads). If Julia can mutate psort!s first argument global vector &#x27;v&#x27; from multiple threads, why can&#x27;t Julia also mutate a single allocated &#x27;temp&#x27; argument global vector? Bonus: then psort! could just merge from one argument to the other and save copying back on each recursion level (along the lines of Segewick&#x27;s nocopy mergesort)?