Exemplo n.º 1
0
 internal InternalPartitionEnumerable(IEnumerator <TSource> sharedReader, bool useSingleChunking, bool isStaticPartitioning)
 {
     this.m_sharedReader      = sharedReader;
     this.m_sharedIndex       = new Partitioner.SharedLong(-1L);
     this.m_hasNoElementsLeft = new Partitioner.SharedBool(false);
     this.m_sourceDepleted    = new Partitioner.SharedBool(false);
     this.m_sharedLock        = new object();
     this.m_useSingleChunking = useSingleChunking;
     if (!this.m_useSingleChunking)
     {
         this.m_FillBuffer = new KeyValuePair <long, TSource> [(PlatformHelper.ProcessorCount > 4 ? 4: 1) * Partitioner.GetDefaultChunkSize <TSource>()];
     }
     if (isStaticPartitioning)
     {
         this.m_activePartitionCount = new Partitioner.SharedInt(0);
     }
     else
     {
         this.m_activePartitionCount = (Partitioner.SharedInt)null;
     }
 }
Exemplo n.º 2
0
 internal InternalPartitionEnumerator(TSource[] sharedReader, Partitioner.SharedLong sharedIndex)
     : base(sharedReader, sharedIndex)
 {
 }
Exemplo n.º 3
0
 internal InternalPartitionEnumerable(TSource[] sharedReader)
 {
     this.m_sharedReader = sharedReader;
     this.m_sharedIndex  = new Partitioner.SharedLong(-1L);
 }
Exemplo n.º 4
0
 protected DynamicPartitionEnumeratorForIndexRange_Abstract(TSourceReader sharedReader, Partitioner.SharedLong sharedIndex)
     : base(sharedReader, sharedIndex)
 {
 }
Exemplo n.º 5
0
 internal InternalPartitionEnumerator(IEnumerator <TSource> sharedReader, Partitioner.SharedLong sharedIndex, Partitioner.SharedBool hasNoElementsLeft, object sharedLock, Partitioner.SharedInt activePartitionCount, Partitioner.DynamicPartitionerForIEnumerable <TSource> .InternalPartitionEnumerable enumerable, bool useSingleChunking)
     : base(sharedReader, sharedIndex, useSingleChunking)
 {
     this.m_hasNoElementsLeft    = hasNoElementsLeft;
     this.m_sharedLock           = sharedLock;
     this.m_enumerable           = enumerable;
     this.m_activePartitionCount = activePartitionCount;
     if (this.m_activePartitionCount == null)
     {
         return;
     }
     Interlocked.Increment(ref this.m_activePartitionCount.Value);
 }
Exemplo n.º 6
0
 protected DynamicPartitionEnumerator_Abstract(TSourceReader sharedReader, Partitioner.SharedLong sharedIndex, bool useSingleChunking)
 {
     this.m_sharedReader = sharedReader;
     this.m_sharedIndex  = sharedIndex;
     this.m_maxChunkSize = useSingleChunking ? 1 : Partitioner.DynamicPartitionEnumerator_Abstract <TSource, TSourceReader> .s_defaultMaxChunkSize;
 }
Exemplo n.º 7
0
 protected DynamicPartitionEnumerator_Abstract(TSourceReader sharedReader, Partitioner.SharedLong sharedIndex)
     : this(sharedReader, sharedIndex, false)
 {
 }