18public static class Partitioner
93 _localOffset.Value = 0;
213 _sourceDepleted.Value =
true;
214 _hasNoElementsLeft.Value =
true;
219 _sourceDepleted.Value =
true;
220 _hasNoElementsLeft.Value =
true;
235 _hasNoElementsLeft.Value =
true;
264 _sourceDepleted.Value =
true;
278 _sourceDepleted.Value =
true;
287 _sourceDepleted.Value =
true;
288 _hasNoElementsLeft.Value =
true;
386 array[i] = enumerable.GetEnumerator();
457 _currentChunkSize.Value = (int)(
num2 - num);
458 _localOffset.Value = -1;
504 if (_currentChunkSize ==
null)
562 if (_currentChunkSize ==
null)
819 long num2 = (long)(num / (decimal)(Environment.ProcessorCount * 3));
926 if (
typeof(TSource).IsValueType)
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
override bool HasNoElementsLeft
override bool GrabNextChunk(int requestedChunkSize)
DynamicPartitionEnumeratorForIndexRange_Abstract(TSourceReader sharedReader, SharedLong sharedIndex)
DynamicPartitionEnumerator_Abstract(TSourceReader sharedReader, SharedLong sharedIndex, bool useSingleChunking)
readonly TSourceReader _sharedReader
StrongBox< int > _localOffset
bool GrabNextChunk(int requestedChunkSize)
StrongBox< int > _currentChunkSize
KeyValuePair< long, TSource > Current
object IEnumerator. Current
readonly SharedLong _sharedIndex
DynamicPartitionEnumerator_Abstract(TSourceReader sharedReader, SharedLong sharedIndex)
readonly int _maxChunkSize
static int s_defaultMaxChunkSize
readonly TSource[] _sharedReader
IEnumerator IEnumerable. GetEnumerator()
IEnumerator< KeyValuePair< long, TSource > > GetEnumerator()
InternalPartitionEnumerable(TSource[] sharedReader)
readonly SharedLong _sharedIndex
InternalPartitionEnumerator(TSource[] sharedReader, SharedLong sharedIndex)
override KeyValuePair< long, TSource > Current
override IEnumerable< KeyValuePair< long, TSource > > GetOrderableDynamicPartitions_Factory(TSource[] _data)
DynamicPartitionerForArray(TSource[] source)
readonly SharedInt _activePartitionCount
void TryCopyFromFillBuffer(KeyValuePair< long, TSource >[] destArray, int requestedChunkSize, ref int actualNumElementsGrabbed)
IEnumerator< KeyValuePair< long, TSource > > GetEnumerator()
volatile KeyValuePair< long, TSource >[] _fillBuffer
volatile int _activeCopiers
volatile int _fillBufferSize
readonly bool _useSingleChunking
readonly SharedLong _sharedIndex
volatile int _fillBufferCurrentPosition
InternalPartitionEnumerable(IEnumerator< TSource > sharedReader, bool useSingleChunking, bool isStaticPartitioning)
readonly object _sharedLock
bool GrabChunk(KeyValuePair< long, TSource >[] destArray, int requestedChunkSize, ref int actualNumElementsGrabbed)
readonly SharedBool _sourceDepleted
readonly SharedBool _hasNoElementsLeft
readonly IEnumerator< TSource > _sharedReader
bool GrabChunk_Single(KeyValuePair< long, TSource >[] destArray, int requestedChunkSize, ref int actualNumElementsGrabbed)
bool GrabChunk_Buffered(KeyValuePair< long, TSource >[] destArray, int requestedChunkSize, ref int actualNumElementsGrabbed)
InternalPartitionEnumerator(IEnumerator< TSource > sharedReader, SharedLong sharedIndex, SharedBool hasNoElementsLeft, SharedInt activePartitionCount, InternalPartitionEnumerable enumerable, bool useSingleChunking)
readonly InternalPartitionEnumerable _enumerable
KeyValuePair< long, TSource >[] _localList
readonly SharedInt _activePartitionCount
override KeyValuePair< long, TSource > Current
readonly SharedBool _hasNoElementsLeft
override bool GrabNextChunk(int requestedChunkSize)
override bool HasNoElementsLeft
readonly bool _useSingleChunking
override IList< IEnumerator< KeyValuePair< long, TSource > > > GetOrderablePartitions(int partitionCount)
DynamicPartitionerForIEnumerable(IEnumerable< TSource > source, EnumerablePartitionerOptions partitionerOptions)
override IEnumerable< KeyValuePair< long, TSource > > GetOrderableDynamicPartitions()
override bool SupportsDynamicPartitions
readonly IEnumerable< TSource > _source
IEnumerator< KeyValuePair< long, TSource > > GetEnumerator()
readonly SharedLong _sharedIndex
InternalPartitionEnumerable(IList< TSource > sharedReader)
readonly IList< TSource > _sharedReader
override KeyValuePair< long, TSource > Current
InternalPartitionEnumerator(IList< TSource > sharedReader, SharedLong sharedIndex)
override IEnumerable< KeyValuePair< long, TSource > > GetOrderableDynamicPartitions_Factory(IList< TSource > _data)
DynamicPartitionerForIList(IList< TSource > source)
DynamicPartitionerForIndexRange_Abstract(TCollection data)
override IList< IEnumerator< KeyValuePair< long, TSource > > > GetOrderablePartitions(int partitionCount)
override bool SupportsDynamicPartitions
IEnumerable< KeyValuePair< long, TSource > > GetOrderableDynamicPartitions_Factory(TCollection data)
override IEnumerable< KeyValuePair< long, TSource > > GetOrderableDynamicPartitions()
readonly TCollection _data
StaticIndexRangePartitionForArray(TSource[] array, int startIndex, int endIndex)
readonly TSource[] _array
override KeyValuePair< long, TSource > Current
override KeyValuePair< long, TSource > Current
readonly IList< TSource > _list
StaticIndexRangePartitionForIList(IList< TSource > list, int startIndex, int endIndex)
object IEnumerator. Current
KeyValuePair< long, TSource > Current
StaticIndexRangePartition(int startIndex, int endIndex)
override IEnumerator< KeyValuePair< long, TSource > > CreatePartition(int startIndex, int endIndex)
StaticIndexRangePartitionerForArray(TSource[] array)
readonly TSource[] _array
StaticIndexRangePartitionerForIList(IList< TSource > list)
override IEnumerator< KeyValuePair< long, TSource > > CreatePartition(int startIndex, int endIndex)
readonly IList< TSource > _list
IEnumerator< KeyValuePair< long, TSource > > CreatePartition(int startIndex, int endIndex)
StaticIndexRangePartitioner()
override IList< IEnumerator< KeyValuePair< long, TSource > > > GetOrderablePartitions(int partitionCount)
static int GetDefaultChunkSize< TSource >()
static OrderablePartitioner< TSource > Create< TSource >(IList< TSource > list, bool loadBalance)
virtual bool SupportsDynamicPartitions
static OrderablePartitioner< Tuple< int, int > > Create(int fromInclusive, int toExclusive, int rangeSize)
virtual IEnumerable< TSource > GetDynamicPartitions()
IList< IEnumerator< TSource > > GetPartitions(int partitionCount)
static OrderablePartitioner< Tuple< int, int > > Create(int fromInclusive, int toExclusive)
static IEnumerable< Tuple< int, int > > CreateRanges(int fromInclusive, int toExclusive, int rangeSize)
static OrderablePartitioner< Tuple< long, long > > Create(long fromInclusive, long toExclusive)
static IEnumerable< Tuple< long, long > > CreateRanges(long fromInclusive, long toExclusive, long rangeSize)
static OrderablePartitioner< Tuple< long, long > > Create(long fromInclusive, long toExclusive, long rangeSize)
Enumerator GetEnumerator()
static int ProcessorCount
static byte Min(byte val1, byte val2)
static string PartitionerStatic_CanNotCallGetEnumeratorAfterSourceHasBeenDisposed
static string Partitioner_DynamicPartitionsNotSupported
static string PartitionerStatic_CurrentCalledBeforeMoveNext
static int CompareExchange(ref int location1, int value, int comparand)
static int Decrement(ref int location)
static int Add(ref int location1, int value)
static int Increment(ref int location)
static bool Read(ref bool location)
IEnumerator GetEnumerator()
EnumerablePartitionerOptions