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)
170
Shared<int> sharedCurrentIndex = new
Shared
<int>(0);
171
Shared<int> sharedPartitionCount = new
Shared
<int>(partitionCount);
172
Shared<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)
41
private 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)
137
return WithPerExecutionSettings(new CancellationTokenSource(), new
Shared
<bool>(false));
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (1)
106
Shared<bool> resultFoundFlag = new
Shared
<bool>(false);
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (1)
90
Shared<bool> resultFoundFlag = new
Shared
<bool>(false);
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (1)
65
Shared<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)
83
Shared<bool> resultFoundFlag = new
Shared
<bool>(false);
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (1)
51
Shared<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)
62
Shared<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)
49
TopLevelDisposedFlag = 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)
79
private
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)
85
private
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)
27
private readonly
Shared
<TInputOutput[]?> _results; // The array where results are stored.
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (11)
170
Shared
<int> sharedCurrentIndex = new Shared<int>(0);
171
Shared
<int> sharedPartitionCount = new Shared<int>(partitionCount);
172
Shared
<bool> sharedExceptionTracker = new Shared<bool>(false);
336
private
Shared
<int>? _currentIndex; // The current index (lazily allocated).
507
private
Shared
<int>? _currentIndex; // The current index (lazily allocated).
563
private readonly
Shared
<int> _currentIndex; // The index shared by all.
564
private readonly
Shared
<int> _activeEnumeratorsCount; // How many enumerators over the same source have not been disposed yet?
565
private readonly
Shared
<bool> _exceptionTracker;
593
IEnumerator<T> source,
Shared
<bool> exceptionTracker, object sourceSyncLock,
Shared
<int> currentIndex,
Shared
<int> degreeOfParallelism)
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (1)
144
private
Shared
<int>? _outputLoopCount;
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (1)
133
private
Shared
<int>? _outputLoopCount;
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (1)
189
private
Shared
<int>? _outputLoopCount;
System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs (1)
41
private 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)
140
internal QuerySettings WithPerExecutionSettings(CancellationTokenSource topLevelCancellationTokenSource,
Shared
<bool> topLevelDisposedFlag)
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (3)
106
Shared
<bool> resultFoundFlag = new Shared<bool>(false);
155
private readonly
Shared
<bool> _resultFoundFlag; // Whether to cancel the search for elements.
163
Func<TInput, bool> predicate, int partitionIndex,
Shared
<bool> resultFoundFlag,
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (3)
90
Shared
<bool> resultFoundFlag = new Shared<bool>(false);
133
private readonly
Shared
<bool> _resultFoundFlag; // Whether to cancel the operation.
141
IEqualityComparer<TInput> comparer, int partitionIndex,
Shared
<bool> resultFoundFlag,
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (3)
65
Shared
<int> sharedEmptyCount = new Shared<int>(0);
112
private readonly
Shared
<int> _sharedEmptyCount; // The number of empty partitions.
123
Shared
<int> sharedEmptyCount, CountdownEvent sharedLatch, CancellationToken cancelToken)
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (1)
124
private
Shared
<int>? _outputLoopCount; // Allocated in MoveNext to avoid false sharing.
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (3)
83
Shared
<bool> resultFoundFlag = new Shared<bool>(false);
171
private readonly
Shared
<bool> _resultFoundFlag; // Whether to cancel the operation.
179
int index,
Shared
<bool> resultFoundFlag,
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (1)
51
Shared
<bool> dummyTopLevelDisposeFlag = new Shared<bool>(false);
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (1)
144
private
Shared
<int>? _outputLoopCount;
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (1)
109
private
Shared
<int>? _bufferIndex; // Our current index within the buffer. [allocate in moveNext to avoid false-sharing]
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (3)
62
Shared
<int> totalElementCount = new Shared<int>(0);
104
private readonly
Shared
<int> _totalElementCount; // The total count of elements found.
111
Func<TSource, bool>? predicate,
Shared
<int> totalElementCount)
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (1)
164
private
Shared
<int>? _bufferIndex; // Our current index within the buffer. [allocate in moveNext to avoid false-sharing]
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (1)
219
private
Shared
<int>? _bufferIndex; // Our current index within the buffer. [allocate in moveNext to avoid false-sharing]
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (1)
107
private
Shared
<int>? _outputLoopCount;
System\Linq\Parallel\Scheduling\CancellationState.cs (1)
44
internal
Shared
<bool> TopLevelDisposedFlag;
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (3)
27
private readonly
Shared
<TInputOutput[]?> _results; // The destination array cell into which data is placed.
45
Shared
<TInputOutput[]?> results, SortHelper<TInputOutput> sortHelper) :
72
Shared
<TInputOutput[]?> results, TaskScheduler taskScheduler)