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
- EditBehavior.cs
- ThreadStateException.cs
- Cursors.cs
- StylusPointProperties.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- Queue.cs
- FocusManager.cs
- PageAsyncTaskManager.cs
- OverflowException.cs
- TriState.cs
- Freezable.cs
- XmlSchemaSimpleContent.cs
- DbParameterHelper.cs
- NodeFunctions.cs
- ThreadStaticAttribute.cs
- IteratorDescriptor.cs
- _CookieModule.cs
- PerformanceCounterLib.cs
- ExpressionTable.cs
- webproxy.cs
- NavigatorOutput.cs
- DataGridViewCellStyleChangedEventArgs.cs
- Attributes.cs
- Membership.cs
- StringTraceRecord.cs
- CodeCompileUnit.cs
- MimeTypeAttribute.cs
- TimeSpanConverter.cs
- SafeCryptoHandles.cs
- ResponseBodyWriter.cs
- AsyncWaitHandle.cs
- RawStylusSystemGestureInputReport.cs
- DesignerActionUIStateChangeEventArgs.cs
- NTAccount.cs
- LayoutTableCell.cs
- TableRow.cs
- PathSegment.cs
- _SingleItemRequestCache.cs
- PriorityQueue.cs
- TypedServiceOperationListItem.cs
- TextBoxRenderer.cs
- SByte.cs
- SecurityUtils.cs
- MaskedTextProvider.cs
- SafeProcessHandle.cs
- UnsignedPublishLicense.cs
- HttpClientProtocol.cs
- HwndProxyElementProvider.cs
- XmlDataProvider.cs
- ColumnResult.cs
- FontNamesConverter.cs
- OutputCacheSettingsSection.cs
- ModuleConfigurationInfo.cs
- Trace.cs
- Vector3DAnimationUsingKeyFrames.cs
- WhitespaceReader.cs
- SamlAuthorizationDecisionClaimResource.cs
- Add.cs
- TypeConverter.cs
- XXXInfos.cs
- Msec.cs
- Setter.cs
- UiaCoreProviderApi.cs
- FontFamilyValueSerializer.cs
- keycontainerpermission.cs
- NetworkAddressChange.cs
- TraceSection.cs
- Region.cs
- HttpRuntime.cs
- WebResourceAttribute.cs
- WebPartDisplayMode.cs
- X509SecurityTokenAuthenticator.cs
- WorkflowFileItem.cs
- Multiply.cs
- Keyboard.cs
- PieceNameHelper.cs
- DocumentCollection.cs
- XNodeValidator.cs
- SiteIdentityPermission.cs
- HttpResponseBase.cs
- PackageRelationshipSelector.cs
- GregorianCalendarHelper.cs
- HelloMessageApril2005.cs
- PeerTransportCredentialType.cs
- SqlProfileProvider.cs
- ComponentResourceManager.cs
- EditorPartCollection.cs
- ProcessManager.cs
- sitestring.cs
- MemoryStream.cs
- basecomparevalidator.cs
- EditorBrowsableAttribute.cs
- PersonalizationAdministration.cs
- SingleTagSectionHandler.cs
- ProfileInfo.cs
- IsolatedStorageSecurityState.cs
- JapaneseCalendar.cs
- XamlStream.cs
- TraceUtils.cs
- InvalidFilterCriteriaException.cs