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
- SQLDouble.cs
- RangeValidator.cs
- Floater.cs
- User.cs
- MetadataArtifactLoaderCompositeFile.cs
- shaper.cs
- MsmqProcessProtocolHandler.cs
- Panel.cs
- UndirectedGraph.cs
- OTFRasterizer.cs
- WebPartDisplayModeEventArgs.cs
- TableLayoutSettingsTypeConverter.cs
- ChannelFactoryRefCache.cs
- CheckBoxRenderer.cs
- TextDecorationCollection.cs
- TypeValidationEventArgs.cs
- ArrayMergeHelper.cs
- SessionStateUtil.cs
- AxHost.cs
- InputScopeNameConverter.cs
- SiteMapPath.cs
- QilBinary.cs
- NativeMethods.cs
- BaseTemplateParser.cs
- BitHelper.cs
- CatalogZone.cs
- DictionaryBase.cs
- HashJoinQueryOperatorEnumerator.cs
- FixedTextSelectionProcessor.cs
- FakeModelPropertyImpl.cs
- MenuItem.cs
- GridViewActionList.cs
- Line.cs
- SqlBulkCopyColumnMappingCollection.cs
- CodeCompiler.cs
- regiisutil.cs
- TextStore.cs
- DescendantOverDescendantQuery.cs
- DataGridViewRow.cs
- SimpleWebHandlerParser.cs
- GlyphInfoList.cs
- RandomNumberGenerator.cs
- XmlSerializerVersionAttribute.cs
- SQLBinaryStorage.cs
- HttpStreamXmlDictionaryReader.cs
- ArrangedElement.cs
- TemplateXamlParser.cs
- DoubleLinkList.cs
- QilFunction.cs
- CredentialCache.cs
- XmlUtilWriter.cs
- TableLayoutStyleCollection.cs
- MessageBox.cs
- MembershipUser.cs
- SqlCommandSet.cs
- ConfigXmlAttribute.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- DCSafeHandle.cs
- WebMessageEncodingBindingElement.cs
- RuntimeHelpers.cs
- UnSafeCharBuffer.cs
- RegexParser.cs
- EdgeProfileValidation.cs
- DataGridViewCell.cs
- Splitter.cs
- EndpointNameMessageFilter.cs
- AutomationTextAttribute.cs
- Win32SafeHandles.cs
- XmlWrappingReader.cs
- ListBox.cs
- BitmapMetadataBlob.cs
- BufferedGraphicsManager.cs
- XsdCachingReader.cs
- CodeIdentifier.cs
- CalendarSelectionChangedEventArgs.cs
- ListDictionaryInternal.cs
- Parameter.cs
- TextTreePropertyUndoUnit.cs
- LabelDesigner.cs
- RecordsAffectedEventArgs.cs
- XsdBuilder.cs
- PerformanceCounterManager.cs
- RepeatBehavior.cs
- CustomAttributeFormatException.cs
- Wizard.cs
- TargetParameterCountException.cs
- Axis.cs
- LocationFactory.cs
- DocumentReference.cs
- IgnoreSectionHandler.cs
- ProjectionPruner.cs
- IDReferencePropertyAttribute.cs
- FusionWrap.cs
- DocumentViewerAutomationPeer.cs
- HtmlFormWrapper.cs
- FilePrompt.cs
- SoapSchemaExporter.cs
- VSWCFServiceContractGenerator.cs
- PartManifestEntry.cs
- WebConfigurationFileMap.cs