Nucleoc::ParSort
Class methods
sort(array : Array(T), is_less : T, T -> Bool = ->(a : T, b : T) do
a < b
end, canceled : CancelFlag | Nil = nil) : Bool forall T
Sorts array in parallel using a hybrid algorithm.
The algorithm is a parallel quicksort that switches to insertion sort for small partitions and uses a work-stealing approach for load balancing.
is_lessshould returntrueif its first argument is strictly less than its second.canceledis an atomic flag that can be set totrueto cancel the sort. If canceled, aCancellationErroris raised in worker fibers.
Returns true if the sort was canceled, false otherwise.