Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Linq / Parallel / Partitioning / OrderedHashRepartitionStream.cs / 1305376 / OrderedHashRepartitionStream.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
//
// OrderedHashRepartitionStream.cs
//
// [....]
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
using System.Collections.Generic;
using System.Threading;
namespace System.Linq.Parallel
{
internal class OrderedHashRepartitionStream : HashRepartitionStream
{
internal OrderedHashRepartitionStream(
PartitionedStream inputStream, Func hashKeySelector,
IEqualityComparer hashKeyComparer, IEqualityComparer elementComparer, CancellationToken cancellationToken)
: base(inputStream.PartitionCount, inputStream.KeyComparer, hashKeyComparer, elementComparer)
{
m_partitions =
new OrderedHashRepartitionEnumerator[inputStream.PartitionCount];
// Initialize state shared among the partitions. A latch and a matrix of buffers. Note that
// the actual elements in the buffer array are lazily allocated if needed.
CountdownEvent barrier = new CountdownEvent(inputStream.PartitionCount);
ListChunk>[,] valueExchangeMatrix =
new ListChunk>[inputStream.PartitionCount, inputStream.PartitionCount];
ListChunk[,] keyExchangeMatrix = new ListChunk[inputStream.PartitionCount, inputStream.PartitionCount];
// Now construct each partition object.
for (int i = 0; i < inputStream.PartitionCount; i++)
{
m_partitions[i] = new OrderedHashRepartitionEnumerator(
inputStream[i], inputStream.PartitionCount, i, hashKeySelector, this, barrier,
valueExchangeMatrix, keyExchangeMatrix, cancellationToken);
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ListenerSessionConnection.cs
- MetadataCache.cs
- CssStyleCollection.cs
- BitmapVisualManager.cs
- PackWebRequestFactory.cs
- TdsEnums.cs
- ReferenceService.cs
- FileIOPermission.cs
- KeyPressEvent.cs
- ListViewTableCell.cs
- DecimalConstantAttribute.cs
- HitTestWithPointDrawingContextWalker.cs
- PropertyRef.cs
- Point3DKeyFrameCollection.cs
- TextOnlyOutput.cs
- TypeConverters.cs
- DataProtectionSecurityStateEncoder.cs
- BindableTemplateBuilder.cs
- ArrayHelper.cs
- ValidationRule.cs
- WebRequestModulesSection.cs
- NetDataContractSerializer.cs
- StringResourceManager.cs
- WindowsListView.cs
- basevalidator.cs
- Query.cs
- UInt16Converter.cs
- sqlnorm.cs
- RecognitionResult.cs
- DrawListViewColumnHeaderEventArgs.cs
- BoundPropertyEntry.cs
- CustomValidator.cs
- SchemaMapping.cs
- RSACryptoServiceProvider.cs
- ExceptionHelpers.cs
- TraceListener.cs
- AudioFormatConverter.cs
- BroadcastEventHelper.cs
- PropertyTabChangedEvent.cs
- NativeObjectSecurity.cs
- UIElementParagraph.cs
- Internal.cs
- ReaderContextStackData.cs
- MatchingStyle.cs
- _AuthenticationState.cs
- SynchronizedDispatch.cs
- ZipIOExtraFieldElement.cs
- Size.cs
- IdSpace.cs
- DataGridPageChangedEventArgs.cs
- SimpleHandlerBuildProvider.cs
- WindowsMenu.cs
- TrackBarRenderer.cs
- securitymgrsite.cs
- ApplicationDirectory.cs
- UserMapPath.cs
- WeakEventTable.cs
- AddDataControlFieldDialog.cs
- UnmanagedHandle.cs
- PermissionSetEnumerator.cs
- CrossContextChannel.cs
- Repeater.cs
- ProgressBarRenderer.cs
- HttpStreamFormatter.cs
- HttpResponseInternalWrapper.cs
- ReadingWritingEntityEventArgs.cs
- WebPartConnectionsCancelVerb.cs
- BufferedGraphics.cs
- LambdaCompiler.Binary.cs
- RegistryConfigurationProvider.cs
- Point3DCollection.cs
- TimelineGroup.cs
- LinearGradientBrush.cs
- XmlQualifiedNameTest.cs
- DeploymentSection.cs
- counter.cs
- FixedSOMTableCell.cs
- XslNumber.cs
- DataBindingExpressionBuilder.cs
- DispatchWrapper.cs
- MailBnfHelper.cs
- ObjectDisposedException.cs
- WebPartConnectionsCancelVerb.cs
- StringSorter.cs
- DataGridViewBand.cs
- __Filters.cs
- DesignerVerb.cs
- Exceptions.cs
- PointAnimationUsingKeyFrames.cs
- ConfigurationSectionHelper.cs
- EventManager.cs
- MenuItemStyle.cs
- PaperSource.cs
- Cursor.cs
- TextRange.cs
- DataGridCell.cs
- DataRelation.cs
- ExitEventArgs.cs
- SendMailErrorEventArgs.cs
- DPTypeDescriptorContext.cs