Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- JulianCalendar.cs
- SafeNativeMethods.cs
- UrlMappingsSection.cs
- X509WindowsSecurityToken.cs
- MinimizableAttributeTypeConverter.cs
- SHA256.cs
- InlineCollection.cs
- FileDialogCustomPlacesCollection.cs
- DockAndAnchorLayout.cs
- BitmapSource.cs
- FileDialog.cs
- TemplateControl.cs
- WSTrust.cs
- CounterSet.cs
- ToolStripOverflow.cs
- IOThreadScheduler.cs
- XmlHierarchicalEnumerable.cs
- COM2PropertyDescriptor.cs
- Camera.cs
- DataColumnMappingCollection.cs
- TemplateKey.cs
- _IPv4Address.cs
- ListBoxItemWrapperAutomationPeer.cs
- CompoundFileStorageReference.cs
- CompilerState.cs
- Executor.cs
- Variable.cs
- SplitterEvent.cs
- TextBoxBase.cs
- SqlDelegatedTransaction.cs
- DocumentGridPage.cs
- SplineKeyFrames.cs
- IndexedGlyphRun.cs
- ValueProviderWrapper.cs
- Crc32.cs
- TableLayoutColumnStyleCollection.cs
- InstanceOwnerQueryResult.cs
- XmlDocumentFragment.cs
- DoubleLink.cs
- ConsoleKeyInfo.cs
- BidirectionalDictionary.cs
- ServiceOperationParameter.cs
- ClientScriptManager.cs
- Renderer.cs
- StorageAssociationSetMapping.cs
- Timeline.cs
- Renderer.cs
- MethodBody.cs
- TextEditorThreadLocalStore.cs
- BitmapEffectvisualstate.cs
- ResourceReader.cs
- RootContext.cs
- DataListItemCollection.cs
- ServiceNameCollection.cs
- SchemaImporter.cs
- CryptoApi.cs
- FindCriteria11.cs
- ColorMatrix.cs
- ThreadSafeList.cs
- SynchronizationContext.cs
- AutoGeneratedField.cs
- Component.cs
- ControlEvent.cs
- AnnotationComponentManager.cs
- IPAddressCollection.cs
- DefaultWorkflowSchedulerService.cs
- BindToObject.cs
- AnonymousIdentificationModule.cs
- InputReferenceExpression.cs
- OdbcFactory.cs
- ToolStripDropDownButton.cs
- FilterEventArgs.cs
- BindingEntityInfo.cs
- DateTimePicker.cs
- HtmlElementEventArgs.cs
- RuleSettings.cs
- ThreadStaticAttribute.cs
- MultipartContentParser.cs
- OdbcCommandBuilder.cs
- EntityViewGenerationAttribute.cs
- Grant.cs
- StyleXamlTreeBuilder.cs
- Panel.cs
- COM2Properties.cs
- UnsafeNativeMethodsTablet.cs
- EditorAttribute.cs
- IListConverters.cs
- DefaultProxySection.cs
- EnvironmentPermission.cs
- COM2ExtendedUITypeEditor.cs
- Error.cs
- Mapping.cs
- Schema.cs
- CreateRefExpr.cs
- SendKeys.cs
- AuthStoreRoleProvider.cs
- XmlMtomWriter.cs
- HttpApplicationStateWrapper.cs
- SafeCryptoHandles.cs
- SafeFileMappingHandle.cs