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
- safex509handles.cs
- DbProviderConfigurationHandler.cs
- querybuilder.cs
- FormsIdentity.cs
- ThreadLocal.cs
- TabControl.cs
- RepeatButtonAutomationPeer.cs
- TableColumn.cs
- OdbcUtils.cs
- SurrogateSelector.cs
- MetaTable.cs
- SqlNotificationEventArgs.cs
- ViewStateException.cs
- MessageDecoder.cs
- WmpBitmapEncoder.cs
- CacheOutputQuery.cs
- KerberosReceiverSecurityToken.cs
- View.cs
- HealthMonitoringSection.cs
- DoubleIndependentAnimationStorage.cs
- MethodToken.cs
- DesignParameter.cs
- StrongNameKeyPair.cs
- DataServiceOperationContext.cs
- DisableDpiAwarenessAttribute.cs
- SurrogateEncoder.cs
- DockProviderWrapper.cs
- WindowsTokenRoleProvider.cs
- SqlDataSourceEnumerator.cs
- ScriptingJsonSerializationSection.cs
- Soap.cs
- Int64AnimationBase.cs
- DiscoveryInnerClientAdhoc11.cs
- FlowDocumentView.cs
- JsonMessageEncoderFactory.cs
- ValuePattern.cs
- Pkcs7Recipient.cs
- EditorZoneAutoFormat.cs
- HostExecutionContextManager.cs
- EvidenceTypeDescriptor.cs
- Comparer.cs
- DesignerLabelAdapter.cs
- XNameTypeConverter.cs
- documentsequencetextcontainer.cs
- ClientProxyGenerator.cs
- Keyboard.cs
- XamlParser.cs
- HttpProcessUtility.cs
- PathSegmentCollection.cs
- ErrorInfoXmlDocument.cs
- Lazy.cs
- TransactionScope.cs
- COM2ExtendedTypeConverter.cs
- ActivityDesignerAccessibleObject.cs
- PropertyTab.cs
- DoubleLinkListEnumerator.cs
- SelectionListComponentEditor.cs
- LinqDataSourceDisposeEventArgs.cs
- ValidationPropertyAttribute.cs
- XmlReturnReader.cs
- UnsafeNativeMethods.cs
- Double.cs
- WmlControlAdapter.cs
- NativeMethods.cs
- WebContentFormatHelper.cs
- TreeViewDesigner.cs
- RoutedEventValueSerializer.cs
- InvalidOperationException.cs
- CancelEventArgs.cs
- SettingsPropertyWrongTypeException.cs
- ZipIOLocalFileBlock.cs
- Style.cs
- AliasedSlot.cs
- KnownTypeHelper.cs
- Point4D.cs
- StringStorage.cs
- CookieProtection.cs
- MouseButton.cs
- RegisteredScript.cs
- NotImplementedException.cs
- BlobPersonalizationState.cs
- sqlcontext.cs
- XmlSerializationGeneratedCode.cs
- StorageScalarPropertyMapping.cs
- HandlerBase.cs
- ExpressionLexer.cs
- PinnedBufferMemoryStream.cs
- XPathPatternBuilder.cs
- ExtractedStateEntry.cs
- DataContract.cs
- RangeValidator.cs
- UInt16.cs
- RubberbandSelector.cs
- PrinterSettings.cs
- UriWriter.cs
- ReturnValue.cs
- CompositeClientFormatter.cs
- SourceItem.cs
- PriorityBindingExpression.cs
- StylusPointDescription.cs