libpmsort provides a parallel merge-sort algorithm that is interface compatible with qsort(3)
libpmsort provides a parallel merge-sort algorithm that is interface compatible with qsort(3). If the compare function is thread-safe, you may easily swap qsort with pmsort.
Though merge-sort itself is slower then quicksort on average, utilizing multiple CPUs or waiting in parallel for I/O can speed up the sorting tremendously.
Parallel mergesort, interface-compatible with qsort(3);
The compare-function must be thread-safe!
Uses posix-threads, currently hard-coded number of threads (pmsort) or can be
given explicitely (pmsort_mt). The latter function call is of course not
entirely interface compatible with qsort as it needs an additional integer
The benchmark program pm_test will compare pmsort to your system's qsort(3)
and mergesort(3). Testing v0.2 on a 4x PPC970 system yields an advantage of
100% over qsort(3) when sorting pure integers (best-case for serial qsort).
So pmsort(3) takes roughly twice the CPU-time but scales very well with multiple
Remind that this was the worst-case for pmsort(3) - sorting with e. g. an
I/O bound compare function can put pmsort(3) much further in the lead, even on
single processor systems.
What's New in This Release:
tags compare function compatible with with qsort interface compatible case for this release the benchmark the compare merge sort thread safe
Download libpmsort 0.2
Other software in this category
- Desktop Environment
- Science and Engineering
- Text Editing&Processing