# Parallel quicksort openmp

**URL:** <https://discourse.julialang.org/t/parallel-quicksort-openmp/88499>\
**Category:** New to Julia\
**Tags:** parallel, multithreading, sort, sortperm, quicksort\
**Created:** [October 9, 2022, 9:11pm UTC](https://discourse.julialang.org/t/parallel-quicksort-openmp/88499 "2022-10-09T21:11:20Z")\
**Posts on this page:** 1\
**Showing post:** 30

<div class="post-metadata">

**Author:** ![pitsianis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pitsianis/32/26588_2.png) [@pitsianis](https://discourse.julialang.org/u/pitsianis)\
**Post date:** [October 13, 2022, 9:16pm UTC](https://discourse.julialang.org/t/parallel-quicksort-openmp/88499/30 "2022-10-13T21:16:47Z")

</div>

I spawned a new thread, with the two codes in one, here:

> [@@spawn large memory allocation reduced when some code abstracted out in a function](https://discourse.julialang.org/t/spawn-large-memory-allocation-reduced-when-some-code-abstracted-out-in-a-function/88691):
>
> In another discussion, [https://discourse.julialang.org/t/parallel-quicksort-openmp/88499](https://discourse.julialang.org/t/parallel-quicksort-openmp/88499) bizarre behavior that requires further attention and explanation came up. A recursive textbook implementation of quicksort makes no memory allocations as it modifies its argument input vector. However, the straightforward parallelization by @spawning the first recursive call results in a large number and volume of memory allocations. As a result, the parallel code is slower than the sequential. The above …

@gitboy16 or anybody else, please post there the mergesort with the opposite behavior.

---

_[View the full topic](https://discourse.julialang.org/t/parallel-quicksort-openmp/88499)._
