Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Linq / Parallel / Partitioning / UnorderedHashRepartitionStream.cs / 1305376 / UnorderedHashRepartitionStream.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // UnorderedHashRepartitionStream.cs // //[....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; using System.Threading; namespace System.Linq.Parallel { internal class UnorderedHashRepartitionStream: HashRepartitionStream { //---------------------------------------------------------------------------------------- // Creates a new partition exchange operator. // internal UnorderedHashRepartitionStream( PartitionedStream inputStream, Func keySelector, IEqualityComparer keyComparer, IEqualityComparer elementComparer, CancellationToken cancellationToken) : base(inputStream.PartitionCount, Util.GetDefaultComparer (), keyComparer, elementComparer) { // Create our array of partitions. m_partitions = new HashRepartitionEnumerator [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]; // Now construct each partition object. for (int i = 0; i < inputStream.PartitionCount; i++) { m_partitions[i] = new HashRepartitionEnumerator ( inputStream[i], inputStream.PartitionCount, i, keySelector, this, barrier, valueExchangeMatrix, cancellationToken); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // UnorderedHashRepartitionStream.cs // // [....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; using System.Threading; namespace System.Linq.Parallel { internal class UnorderedHashRepartitionStream: HashRepartitionStream { //---------------------------------------------------------------------------------------- // Creates a new partition exchange operator. // internal UnorderedHashRepartitionStream( PartitionedStream inputStream, Func keySelector, IEqualityComparer keyComparer, IEqualityComparer elementComparer, CancellationToken cancellationToken) : base(inputStream.PartitionCount, Util.GetDefaultComparer (), keyComparer, elementComparer) { // Create our array of partitions. m_partitions = new HashRepartitionEnumerator [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]; // Now construct each partition object. for (int i = 0; i < inputStream.PartitionCount; i++) { m_partitions[i] = new HashRepartitionEnumerator ( inputStream[i], inputStream.PartitionCount, i, keySelector, this, barrier, valueExchangeMatrix, 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
- TextTreeTextElementNode.cs
- CodeRemoveEventStatement.cs
- Behavior.cs
- UnsafeNativeMethods.cs
- CodeDomSerializerBase.cs
- FilterQueryOptionExpression.cs
- TemplateContainer.cs
- DataGridPageChangedEventArgs.cs
- Geometry.cs
- GraphicsPathIterator.cs
- QuaternionValueSerializer.cs
- KoreanLunisolarCalendar.cs
- DataObjectAttribute.cs
- DateTimeFormatInfo.cs
- FastEncoderStatics.cs
- DiscoveryReferences.cs
- COM2TypeInfoProcessor.cs
- ParallelTimeline.cs
- LayoutEvent.cs
- OdbcError.cs
- DesignTimeParseData.cs
- SoapSchemaMember.cs
- ContainerSelectorBehavior.cs
- Form.cs
- XmlDocumentType.cs
- IndexingContentUnit.cs
- TextEditorCharacters.cs
- PrimitiveType.cs
- Positioning.cs
- Int32EqualityComparer.cs
- AppDomainFactory.cs
- WebServiceReceive.cs
- XmlLanguage.cs
- DescendantQuery.cs
- CurrentChangingEventArgs.cs
- ImageBrush.cs
- StorageRoot.cs
- SHA384.cs
- ListDictionaryInternal.cs
- DrawingContextDrawingContextWalker.cs
- ProfileInfo.cs
- _WinHttpWebProxyDataBuilder.cs
- SignedXml.cs
- AppModelKnownContentFactory.cs
- XmlnsPrefixAttribute.cs
- CustomAssemblyResolver.cs
- PersonalizationProviderCollection.cs
- TransformDescriptor.cs
- Quaternion.cs
- ReleaseInstanceMode.cs
- SafeRegistryKey.cs
- SystemIPInterfaceStatistics.cs
- IdentityModelStringsVersion1.cs
- ListMarkerLine.cs
- MatcherBuilder.cs
- FtpCachePolicyElement.cs
- MapPathBasedVirtualPathProvider.cs
- FormsAuthenticationConfiguration.cs
- FieldNameLookup.cs
- GregorianCalendar.cs
- Configuration.cs
- ReliableDuplexSessionChannel.cs
- UnsafeNativeMethodsTablet.cs
- FlowDocument.cs
- ConfigurationValidatorAttribute.cs
- DataGridViewCellPaintingEventArgs.cs
- ValidatorCollection.cs
- basemetadatamappingvisitor.cs
- DrawingBrush.cs
- CodeAccessPermission.cs
- QilPatternVisitor.cs
- ModelItemCollection.cs
- HMACRIPEMD160.cs
- Renderer.cs
- SettingsPropertyWrongTypeException.cs
- ReferentialConstraint.cs
- CryptographicAttribute.cs
- CancellationTokenSource.cs
- DataBindingCollection.cs
- DrawToolTipEventArgs.cs
- MarshalByValueComponent.cs
- FastEncoderWindow.cs
- DocumentPageTextView.cs
- XmlNamespaceManager.cs
- AstNode.cs
- AssemblyAttributes.cs
- TypeElement.cs
- AxWrapperGen.cs
- DateTimeOffsetStorage.cs
- XmlSchemaType.cs
- CssTextWriter.cs
- BitmapCodecInfo.cs
- CalendarData.cs
- XmlConvert.cs
- ComAwareEventInfo.cs
- ToolStripPanelRow.cs
- OracleRowUpdatingEventArgs.cs
- RijndaelManaged.cs
- SmtpSection.cs
- DesignerAttributeInfo.cs