ParallelHelperSortT(ArraySectionT, IComparerT) Method
Sorts the elements of the specified
ArraySectionT synchronously, potentially using multiple threads.
Namespace: KGySoft.ThreadingAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.5.0
public static void Sort<T>(
ArraySection<T> array,
IComparer<T>? comparer = null
)
Public Shared Sub Sort(Of T) (
array As ArraySection(Of T),
Optional comparer As IComparer(Of T) = Nothing
)
public:
generic<typename T>
static void Sort(
ArraySection<T> array,
IComparer<T>^ comparer = nullptr
)
static member Sort :
array : ArraySection<'T> *
?comparer : IComparer<'T>
(* Defaults:
let _comparer = defaultArg comparer null
*)
-> unit
- array ArraySectionT
- The ArraySectionT instance to sort.
- comparer IComparerT (Optional)
- The IComparerT implementation to use when comparing elements, or to use a default comparer. This parameter is optional.
Default value: .
- T
- The type of the elements in the ArraySectionT.
This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation.
Use the overloads with a
ParallelConfig parameter to adjust parallelization and to set up cancellation;
or the
BeginSort/
SortAsync
(in .NET Framework 4.0 and above) methods to perform the sorting asynchronously.