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
- MatrixAnimationUsingPath.cs
- FileLogRecordStream.cs
- UrlMapping.cs
- IPEndPoint.cs
- Delegate.cs
- Blend.cs
- RealizationDrawingContextWalker.cs
- GradientStop.cs
- HttpConfigurationSystem.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- SelectedDatesCollection.cs
- EntityCommandDefinition.cs
- SubstitutionDesigner.cs
- IssuanceLicense.cs
- ProcessHostFactoryHelper.cs
- ConnectionStringsExpressionBuilder.cs
- XmlSerializationGeneratedCode.cs
- MetadataArtifactLoader.cs
- XPathNodeIterator.cs
- MenuItem.cs
- CompressedStack.cs
- AuthenticationModuleElement.cs
- PkcsMisc.cs
- SubMenuStyle.cs
- DefinitionProperties.cs
- RichTextBoxAutomationPeer.cs
- TagNameToTypeMapper.cs
- safemediahandle.cs
- TextFormatterImp.cs
- ServiceProviders.cs
- CreateParams.cs
- ProcessThread.cs
- sqlinternaltransaction.cs
- ConfigurationValue.cs
- CharKeyFrameCollection.cs
- CodeExporter.cs
- ThreadStateException.cs
- ManualResetEvent.cs
- Color.cs
- FilterRepeater.cs
- DoubleUtil.cs
- Solver.cs
- PatternMatchRules.cs
- Perspective.cs
- _HelperAsyncResults.cs
- SiteOfOriginPart.cs
- XmlText.cs
- WebControl.cs
- wgx_render.cs
- Model3D.cs
- HttpCookieCollection.cs
- SqlClientMetaDataCollectionNames.cs
- WindowsRegion.cs
- _ListenerRequestStream.cs
- EntityKey.cs
- InvalidOleVariantTypeException.cs
- PermissionSetTriple.cs
- ResourcesGenerator.cs
- HTMLTextWriter.cs
- ImmComposition.cs
- DataFormats.cs
- SingleObjectCollection.cs
- MetadataItem.cs
- EndpointIdentityExtension.cs
- QueryPageSettingsEventArgs.cs
- EdmConstants.cs
- StandardTransformFactory.cs
- EventPropertyMap.cs
- SessionPageStatePersister.cs
- XmlSerializationGeneratedCode.cs
- ReferenceEqualityComparer.cs
- PageAsyncTask.cs
- MethodAccessException.cs
- RenderContext.cs
- ButtonFlatAdapter.cs
- XmlRawWriter.cs
- DataContractFormatAttribute.cs
- ButtonAutomationPeer.cs
- SeparatorAutomationPeer.cs
- SqlCacheDependencyDatabase.cs
- Int32EqualityComparer.cs
- SQLBytesStorage.cs
- QilInvoke.cs
- RuleInfoComparer.cs
- PageAdapter.cs
- CalendarButtonAutomationPeer.cs
- AppDomainInfo.cs
- ExitEventArgs.cs
- MessageBox.cs
- Pen.cs
- AddInSegmentDirectoryNotFoundException.cs
- DetailsViewActionList.cs
- TryExpression.cs
- GenericTypeParameterBuilder.cs
- RepeatButtonAutomationPeer.cs
- ListViewTableCell.cs
- SelectionRange.cs
- ResourceWriter.cs
- Journaling.cs
- TextViewSelectionProcessor.cs