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
- ToolStripDesignerAvailabilityAttribute.cs
- DataPagerField.cs
- CreateUserErrorEventArgs.cs
- HtmlInputFile.cs
- DataGridViewRowPostPaintEventArgs.cs
- SegmentInfo.cs
- HideDisabledControlAdapter.cs
- WeakEventTable.cs
- EngineSite.cs
- AsyncDataRequest.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- TcpClientSocketManager.cs
- LinkedList.cs
- HttpListenerResponse.cs
- SBCSCodePageEncoding.cs
- IPAddress.cs
- LinkConverter.cs
- MarkupWriter.cs
- ToolStripHighContrastRenderer.cs
- BuilderInfo.cs
- SoapIncludeAttribute.cs
- DropTarget.cs
- contentDescriptor.cs
- _TransmitFileOverlappedAsyncResult.cs
- TreeWalkHelper.cs
- Effect.cs
- ServicesUtilities.cs
- NullExtension.cs
- OracleConnectionStringBuilder.cs
- HtmlSelect.cs
- HtmlWindow.cs
- EncodingInfo.cs
- Aggregates.cs
- PaginationProgressEventArgs.cs
- DialogBaseForm.cs
- Geometry3D.cs
- StylusPlugin.cs
- Types.cs
- IProvider.cs
- RequestCacheManager.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- SqlGatherProducedAliases.cs
- SourceSwitch.cs
- Facet.cs
- BitmapDecoder.cs
- CacheSection.cs
- SqlCacheDependencyDatabaseCollection.cs
- XPathEmptyIterator.cs
- XmlObjectSerializerReadContextComplex.cs
- Matrix3DValueSerializer.cs
- StructuredProperty.cs
- ServiceModelActivationSectionGroup.cs
- MarkupCompilePass1.cs
- GridViewRow.cs
- WorkflowApplicationAbortedEventArgs.cs
- InputLanguage.cs
- SqlClientWrapperSmiStreamChars.cs
- ToolBarPanel.cs
- ForwardPositionQuery.cs
- CodeDelegateInvokeExpression.cs
- HttpWebRequestElement.cs
- SafeBitVector32.cs
- XmlChoiceIdentifierAttribute.cs
- FormatException.cs
- Constants.cs
- odbcmetadatacolumnnames.cs
- FixedFlowMap.cs
- XomlSerializationHelpers.cs
- DeviceContext.cs
- PeerNameRecord.cs
- HostSecurityManager.cs
- SaveFileDialog.cs
- CommandLibraryHelper.cs
- DataGridViewCellMouseEventArgs.cs
- TimeSpanStorage.cs
- FlowchartDesignerCommands.cs
- BitmapEffectInput.cs
- TraceLog.cs
- IFormattable.cs
- ServerValidateEventArgs.cs
- DocumentPageHost.cs
- SafeEventLogReadHandle.cs
- SqlBuffer.cs
- FusionWrap.cs
- _MultipleConnectAsync.cs
- _CacheStreams.cs
- ControlBindingsConverter.cs
- processwaithandle.cs
- StreamUpdate.cs
- BamlRecordReader.cs
- KerberosSecurityTokenProvider.cs
- XmlNamespaceManager.cs
- StringBlob.cs
- PersonalizationDictionary.cs
- IdentifierCollection.cs
- Decimal.cs
- DataSourceCache.cs
- WindowsStreamSecurityBindingElement.cs
- FigureParaClient.cs
- ReadOnlyHierarchicalDataSourceView.cs