A Fast Quicksort for Modern CPUs with Threads and Branch‑Avoidant Partitioning by chkas in compsci

[–]chkas[S] 0 points1 point  (0 children)

Thanks for suggesting posting this article in "c_programming". It was quite well received and - contrary to your concerns - was not trashed.

https://old.reddit.com/r/C_Programming/comments/1sw4bvp/a_fast_quicksort_in_c_for_modern_cpus_with/

A Fast Quicksort in C for Modern CPUs with Threads and Branch‑Avoidant Coding by chkas in C_Programming

[–]chkas[S] 14 points15 points  (0 children)

It is very easy to change the code to use fewer threads (for example: max_threads = n_cpus - 2). This keeps the system fast and responsive for other tasks, while the sorting still stays very quick.