Skip to content
FutureBlitz

    Install

    Import std.concurrent.parallel

    ParallelSort

    std.concurrent.parallel

    function

    Public Function ParallelSort<T>(items: T[])

    Sorts the items in place, smallest first, keeping equal ones in their order, as T[]'s Sort does: parts sorted on the pool at once, then merged in pairs, each round's merges at once too. A value that isn't equal to itself, like NaN, has no place in the order, and goes where it may.

    Examples

    Local numbers = [5, 3, 9, 1]
    ParallelSort(numbers)
    Expect(numbers == [1, 3, 5, 9])

    std/concurrent/parallel.fb, line 103

    function

    Public Function ParallelSort<T: Sendable>(items: T[], before: Sendable Func(T, T): Bool)

    Sorts the items in place, those before goes with first, keeping in their order the ones it puts neither before the other, as Sort(before) does.

    std/concurrent/parallel.fb, line 110

    Report an issue with this page or with FutureBlitz on GitHub.