Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- GroupBox.cs
- HtmlInputCheckBox.cs
- EmbeddedMailObjectsCollection.cs
- BorderSidesEditor.cs
- IndexedString.cs
- LocalizableResourceBuilder.cs
- AnchoredBlock.cs
- TimeSpanMinutesConverter.cs
- ReadOnlyCollectionBuilder.cs
- ManualResetEvent.cs
- EqualityArray.cs
- AppSettings.cs
- DataGridViewCellLinkedList.cs
- Model3DGroup.cs
- X509ThumbprintKeyIdentifierClause.cs
- ServiceModelConfigurationSectionGroup.cs
- ToolStripHighContrastRenderer.cs
- LinqDataSourceValidationException.cs
- WebContext.cs
- Token.cs
- GroupBox.cs
- SizeKeyFrameCollection.cs
- ContourSegment.cs
- ExtenderProvidedPropertyAttribute.cs
- Attributes.cs
- SizeLimitedCache.cs
- SafeLocalMemHandle.cs
- SqlCommandBuilder.cs
- RtfToXamlLexer.cs
- LinkUtilities.cs
- AttachedPropertiesService.cs
- WebPartVerbCollection.cs
- ProviderSettingsCollection.cs
- MapPathBasedVirtualPathProvider.cs
- MethodCallTranslator.cs
- DisableDpiAwarenessAttribute.cs
- DoubleAnimationUsingPath.cs
- FixedPageStructure.cs
- XamlSerializerUtil.cs
- SoapExtensionTypeElementCollection.cs
- ToolStripDropDownClosingEventArgs.cs
- QilBinary.cs
- ConfigXmlCDataSection.cs
- ipaddressinformationcollection.cs
- TextRunProperties.cs
- Matrix3D.cs
- ProcessModelSection.cs
- Compiler.cs
- InputProcessorProfiles.cs
- EmptyEnumerator.cs
- QueryStringParameter.cs
- DoubleCollectionValueSerializer.cs
- CDSCollectionETWBCLProvider.cs
- TextControlDesigner.cs
- PopupEventArgs.cs
- StrokeCollectionConverter.cs
- StorageConditionPropertyMapping.cs
- _ListenerResponseStream.cs
- Help.cs
- ResourceManagerWrapper.cs
- EntitySetBaseCollection.cs
- DefaultValueAttribute.cs
- TextProperties.cs
- XmlTextAttribute.cs
- Header.cs
- OperationCanceledException.cs
- MenuItemBindingCollection.cs
- XmlDocumentSerializer.cs
- XPathException.cs
- BitmapEffectInputData.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- SchemaCollectionPreprocessor.cs
- ConstructorNeedsTagAttribute.cs
- Pointer.cs
- HostingPreferredMapPath.cs
- COMException.cs
- SchemaCollectionPreprocessor.cs
- XmlSchemaCollection.cs
- HtmlHead.cs
- EdmTypeAttribute.cs
- HebrewNumber.cs
- _SafeNetHandles.cs
- MinimizableAttributeTypeConverter.cs
- SqlSelectStatement.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- WindowsListViewItem.cs
- ImageListUtils.cs
- RtfToXamlLexer.cs
- Size.cs
- PermissionToken.cs
- SafeEventLogReadHandle.cs
- PropertySourceInfo.cs
- DataPagerField.cs
- StylusButtonCollection.cs
- WebMessageFormatHelper.cs
- Registration.cs
- TreeNodeStyle.cs
- StrokeDescriptor.cs
- StdValidatorsAndConverters.cs
- Scene3D.cs