27 instantiations of Shared
System.Linq.Parallel (27)
System\Linq\Parallel\Enumerables\RangeEnumerable.cs (1)
99_currentCount ??= new Shared<int>(-1);
System\Linq\Parallel\Enumerables\RepeatEnumerable.cs (1)
104_currentIndex ??= new Shared<int>(-1);
System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs (1)
47_results = new Shared<TInputOutput[]?>(null);
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (5)
170Shared<int> sharedCurrentIndex = new Shared<int>(0); 171Shared<int> sharedPartitionCount = new Shared<int>(partitionCount); 172Shared<bool> sharedExceptionTracker = new Shared<bool>(false); 366_currentIndex ??= new Shared<int>(_startIndex); 537_currentIndex ??= new Shared<int>(_startIndex);
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (1)
178_outputLoopCount = new Shared<int>(0);
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (1)
166_outputLoopCount = new Shared<int>(0);
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (1)
220_outputLoopCount = new Shared<int>(0);
System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs (1)
41private readonly Shared<bool> _topLevelDisposedFlag = new Shared<bool>(false); //a shared<bool> so that it can be referenced by others.
System\Linq\Parallel\QueryOperators\QuerySettings.cs (1)
137return WithPerExecutionSettings(new CancellationTokenSource(), new Shared<bool>(false));
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (1)
106Shared<bool> resultFoundFlag = new Shared<bool>(false);
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (1)
90Shared<bool> resultFoundFlag = new Shared<bool>(false);
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (1)
65Shared<int> sharedEmptyCount = new Shared<int>(0);
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (1)
153_outputLoopCount ??= new Shared<int>(0);
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (1)
83Shared<bool> resultFoundFlag = new Shared<bool>(false);
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (1)
51Shared<bool> dummyTopLevelDisposeFlag = new Shared<bool>(false);
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (1)
170_outputLoopCount ??= new Shared<int>(0);
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (1)
132_bufferIndex = new Shared<int>(0);
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (1)
62Shared<int> totalElementCount = new Shared<int>(0);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (1)
236_bufferIndex = new Shared<int>(-1);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (1)
339_bufferIndex = new Shared<int>(-1);
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (1)
135_outputLoopCount ??= new Shared<int>(0);
System\Linq\Parallel\Scheduling\CancellationState.cs (1)
49TopLevelDisposedFlag = new Shared<bool>(false); //it would always be initialized to false, so no harm doing it here and avoid #if around constructors.
System\Linq\ParallelEnumerable.cs (1)
4386.WithPerExecutionSettings(new CancellationTokenSource(), new System.Linq.Parallel.Shared<bool>(false));
45 references to Shared
System.Linq.Parallel (45)
System\Linq\Parallel\Enumerables\RangeEnumerable.cs (1)
79private Shared<int>? _currentCount; // The 0-based index of the current value. [allocate in moveNext to avoid false-sharing]
System\Linq\Parallel\Enumerables\RepeatEnumerable.cs (1)
85private Shared<int>? _currentIndex; // The number of times we have already repeated it. [allocate in moveNext to avoid false-sharing]
System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs (1)
27private readonly Shared<TInputOutput[]?> _results; // The array where results are stored.
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (11)
170Shared<int> sharedCurrentIndex = new Shared<int>(0); 171Shared<int> sharedPartitionCount = new Shared<int>(partitionCount); 172Shared<bool> sharedExceptionTracker = new Shared<bool>(false); 336private Shared<int>? _currentIndex; // The current index (lazily allocated). 507private Shared<int>? _currentIndex; // The current index (lazily allocated). 563private readonly Shared<int> _currentIndex; // The index shared by all. 564private readonly Shared<int> _activeEnumeratorsCount; // How many enumerators over the same source have not been disposed yet? 565private readonly Shared<bool> _exceptionTracker; 593IEnumerator<T> source, Shared<bool> exceptionTracker, object sourceSyncLock, Shared<int> currentIndex, Shared<int> degreeOfParallelism)
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (1)
144private Shared<int>? _outputLoopCount;
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (1)
133private Shared<int>? _outputLoopCount;
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (1)
189private Shared<int>? _outputLoopCount;
System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs (1)
41private readonly Shared<bool> _topLevelDisposedFlag = new Shared<bool>(false); //a shared<bool> so that it can be referenced by others.
System\Linq\Parallel\QueryOperators\QuerySettings.cs (1)
140internal QuerySettings WithPerExecutionSettings(CancellationTokenSource topLevelCancellationTokenSource, Shared<bool> topLevelDisposedFlag)
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (3)
106Shared<bool> resultFoundFlag = new Shared<bool>(false); 155private readonly Shared<bool> _resultFoundFlag; // Whether to cancel the search for elements. 163Func<TInput, bool> predicate, int partitionIndex, Shared<bool> resultFoundFlag,
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (3)
90Shared<bool> resultFoundFlag = new Shared<bool>(false); 133private readonly Shared<bool> _resultFoundFlag; // Whether to cancel the operation. 141IEqualityComparer<TInput> comparer, int partitionIndex, Shared<bool> resultFoundFlag,
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (3)
65Shared<int> sharedEmptyCount = new Shared<int>(0); 112private readonly Shared<int> _sharedEmptyCount; // The number of empty partitions. 123Shared<int> sharedEmptyCount, CountdownEvent sharedLatch, CancellationToken cancelToken)
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (1)
124private Shared<int>? _outputLoopCount; // Allocated in MoveNext to avoid false sharing.
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (3)
83Shared<bool> resultFoundFlag = new Shared<bool>(false); 171private readonly Shared<bool> _resultFoundFlag; // Whether to cancel the operation. 179int index, Shared<bool> resultFoundFlag,
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (1)
51Shared<bool> dummyTopLevelDisposeFlag = new Shared<bool>(false);
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (1)
144private Shared<int>? _outputLoopCount;
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (1)
109private Shared<int>? _bufferIndex; // Our current index within the buffer. [allocate in moveNext to avoid false-sharing]
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (3)
62Shared<int> totalElementCount = new Shared<int>(0); 104private readonly Shared<int> _totalElementCount; // The total count of elements found. 111Func<TSource, bool>? predicate, Shared<int> totalElementCount)
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (1)
164private Shared<int>? _bufferIndex; // Our current index within the buffer. [allocate in moveNext to avoid false-sharing]
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (1)
219private Shared<int>? _bufferIndex; // Our current index within the buffer. [allocate in moveNext to avoid false-sharing]
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (1)
107private Shared<int>? _outputLoopCount;
System\Linq\Parallel\Scheduling\CancellationState.cs (1)
44internal Shared<bool> TopLevelDisposedFlag;
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (3)
27private readonly Shared<TInputOutput[]?> _results; // The destination array cell into which data is placed. 45Shared<TInputOutput[]?> results, SortHelper<TInputOutput> sortHelper) : 72Shared<TInputOutput[]?> results, TaskScheduler taskScheduler)