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
- ElementHostAutomationPeer.cs
- ComponentFactoryHelpers.cs
- DynamicILGenerator.cs
- Vector3DValueSerializer.cs
- WindowsListViewGroupSubsetLink.cs
- SqlDataAdapter.cs
- _KerberosClient.cs
- ConfigurationLoader.cs
- SchemaNames.cs
- MenuRenderer.cs
- EventLogPermissionEntryCollection.cs
- DBDataPermission.cs
- ObjectView.cs
- CroppedBitmap.cs
- Point3DAnimation.cs
- FixedTextBuilder.cs
- DataBindingCollectionConverter.cs
- Socket.cs
- RepeatButtonAutomationPeer.cs
- templategroup.cs
- StylusTip.cs
- TreeViewItem.cs
- ADRole.cs
- Invariant.cs
- DetailsViewInsertEventArgs.cs
- RSAPKCS1SignatureFormatter.cs
- DocumentSequence.cs
- PrintDialog.cs
- XmlBufferReader.cs
- ObjectAssociationEndMapping.cs
- CaseStatementProjectedSlot.cs
- VisualBrush.cs
- PropVariant.cs
- PiiTraceSource.cs
- EdmToObjectNamespaceMap.cs
- MessageBox.cs
- BitmapSizeOptions.cs
- FieldBuilder.cs
- TableLayoutRowStyleCollection.cs
- ListItemConverter.cs
- PeerNearMe.cs
- DistributedTransactionPermission.cs
- XmlSchemaObjectTable.cs
- PathSegment.cs
- xdrvalidator.cs
- RijndaelManaged.cs
- HtmlDocument.cs
- Activator.cs
- ContextCorrelationInitializer.cs
- TextServicesCompartment.cs
- OutputScopeManager.cs
- ColumnMapVisitor.cs
- AssertFilter.cs
- XmlSchemaSearchPattern.cs
- OciHandle.cs
- ColorConvertedBitmapExtension.cs
- BamlTreeMap.cs
- WindowsScrollBarBits.cs
- ToolStripContentPanelRenderEventArgs.cs
- MailWebEventProvider.cs
- PerspectiveCamera.cs
- TextEditorCharacters.cs
- Preprocessor.cs
- XmlDataSource.cs
- ApplicationDirectoryMembershipCondition.cs
- TraceListeners.cs
- PopupControlService.cs
- _ListenerAsyncResult.cs
- XamlGridLengthSerializer.cs
- XmlNamedNodeMap.cs
- XmlToDatasetMap.cs
- PartialTrustValidationBehavior.cs
- mansign.cs
- DesignerVerb.cs
- RenderingEventArgs.cs
- FullTextBreakpoint.cs
- ModuleBuilder.cs
- Normalization.cs
- ParagraphVisual.cs
- RemoveFromCollection.cs
- CharUnicodeInfo.cs
- BaseParser.cs
- SoapSchemaExporter.cs
- DoubleLinkList.cs
- WhitespaceRuleReader.cs
- MenuItemCollection.cs
- ToolStripActionList.cs
- MailSettingsSection.cs
- WindowsTokenRoleProvider.cs
- RewritingValidator.cs
- BrushProxy.cs
- ResourceContainer.cs
- MsdtcClusterUtils.cs
- WebPartsPersonalizationAuthorization.cs
- DynamicPropertyHolder.cs
- StopStoryboard.cs
- XmlSchemaCompilationSettings.cs
- CodeDOMUtility.cs
- ExpressionsCollectionConverter.cs
- StylusCaptureWithinProperty.cs