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
- UpdateManifestForBrowserApplication.cs
- MediaScriptCommandRoutedEventArgs.cs
- _TransmitFileOverlappedAsyncResult.cs
- ExceptionHelpers.cs
- MobileTemplatedControlDesigner.cs
- WinFormsUtils.cs
- CompositeControl.cs
- SR.cs
- OLEDB_Util.cs
- ValuePattern.cs
- AssertSection.cs
- CodeIdentifier.cs
- DrawingVisualDrawingContext.cs
- InnerItemCollectionView.cs
- ThicknessAnimationBase.cs
- RawTextInputReport.cs
- MemoryFailPoint.cs
- SchemaElementLookUpTable.cs
- LoadMessageLogger.cs
- MsmqVerifier.cs
- IdleTimeoutMonitor.cs
- CommandEventArgs.cs
- ContentElementAutomationPeer.cs
- DataGridViewHeaderCell.cs
- PageSetupDialog.cs
- ParallelLoopState.cs
- PrimitiveType.cs
- SafeNativeMethods.cs
- PlainXmlSerializer.cs
- SchemaMerger.cs
- SystemIPv6InterfaceProperties.cs
- SafeCloseHandleCritical.cs
- FieldDescriptor.cs
- ZoomPercentageConverter.cs
- WSFederationHttpBinding.cs
- SelectorItemAutomationPeer.cs
- ShapeTypeface.cs
- ThicknessAnimationUsingKeyFrames.cs
- CaseInsensitiveComparer.cs
- DesignOnlyAttribute.cs
- UnsafeNativeMethodsTablet.cs
- WorkflowApplicationException.cs
- CodeIndexerExpression.cs
- SqlDataSourceEnumerator.cs
- SortQuery.cs
- MessageBox.cs
- CheckBoxList.cs
- CharacterBuffer.cs
- Menu.cs
- ObjectToken.cs
- InvokeGenerator.cs
- HttpModuleAction.cs
- UnsafeNativeMethods.cs
- CaseInsensitiveOrdinalStringComparer.cs
- GridViewColumnCollection.cs
- InkCanvasAutomationPeer.cs
- Clock.cs
- DataGridLinkButton.cs
- UnsafeNativeMethods.cs
- InvalidDataContractException.cs
- ExternalCalls.cs
- Path.cs
- SchemaImporterExtensionElement.cs
- NullableIntSumAggregationOperator.cs
- WebPartManager.cs
- ServiceKnownTypeAttribute.cs
- XamlTreeBuilder.cs
- PropertyRef.cs
- HtmlInputReset.cs
- SmiContext.cs
- SchemaManager.cs
- Dictionary.cs
- WebPartCatalogCloseVerb.cs
- PerformanceCounterScope.cs
- RegexCode.cs
- HyperLink.cs
- ComplusTypeValidator.cs
- JapaneseCalendar.cs
- EmissiveMaterial.cs
- SrgsElementFactory.cs
- JoinCqlBlock.cs
- BrowserDefinition.cs
- PageHandlerFactory.cs
- InputDevice.cs
- BackgroundFormatInfo.cs
- ContentValidator.cs
- MeasurementDCInfo.cs
- SmtpFailedRecipientsException.cs
- RefreshEventArgs.cs
- DesignerProperties.cs
- CodeConstructor.cs
- Color.cs
- StreamAsIStream.cs
- ServicesUtilities.cs
- DeflateEmulationStream.cs
- FormatConvertedBitmap.cs
- KeyValueInternalCollection.cs
- XPathDocumentIterator.cs
- ListView.cs
- MobileCapabilities.cs