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
- RectAnimationClockResource.cs
- Comparer.cs
- PingReply.cs
- HtmlTable.cs
- FontSourceCollection.cs
- ValueQuery.cs
- StorageRoot.cs
- StructuredTypeEmitter.cs
- UrlPath.cs
- MasterPageBuildProvider.cs
- AjaxFrameworkAssemblyAttribute.cs
- NamespaceMapping.cs
- ImplicitInputBrush.cs
- ScriptingProfileServiceSection.cs
- GridViewPageEventArgs.cs
- ReadOnlyDataSource.cs
- BinaryConverter.cs
- _OverlappedAsyncResult.cs
- ScaleTransform.cs
- SqlOuterApplyReducer.cs
- HttpServerVarsCollection.cs
- ErrorInfoXmlDocument.cs
- DesignerAutoFormatStyle.cs
- CurrentChangedEventManager.cs
- LingerOption.cs
- SqlCacheDependency.cs
- Method.cs
- Size3D.cs
- DirectoryNotFoundException.cs
- WebConfigurationFileMap.cs
- InlineCollection.cs
- PagedDataSource.cs
- ListDictionaryInternal.cs
- ToolStripStatusLabel.cs
- IndicFontClient.cs
- Configuration.cs
- PcmConverter.cs
- ActivityScheduledQuery.cs
- HWStack.cs
- DetailsViewRow.cs
- ImageList.cs
- DateTimeHelper.cs
- CodeAccessPermission.cs
- EntityDataSourceState.cs
- FontSource.cs
- ObfuscationAttribute.cs
- SystemIPAddressInformation.cs
- wgx_exports.cs
- PasswordDeriveBytes.cs
- RectConverter.cs
- AvTraceDetails.cs
- ConstrainedDataObject.cs
- ListItemParagraph.cs
- XmlDocumentFragment.cs
- WorkflowRuntimeServiceElementCollection.cs
- ConfigurationPropertyCollection.cs
- SqlEnums.cs
- ClientSettingsStore.cs
- ToolStripPanelCell.cs
- MailBnfHelper.cs
- WebBrowserHelper.cs
- XmlAggregates.cs
- Lasso.cs
- FixedSOMPageConstructor.cs
- InkCanvasFeedbackAdorner.cs
- AuthorizationRule.cs
- AuthenticationService.cs
- PasswordTextContainer.cs
- TemplatedAdorner.cs
- DataControlFieldCollection.cs
- GridView.cs
- DtdParser.cs
- HttpRuntimeSection.cs
- DataGridViewUtilities.cs
- DbConnectionStringCommon.cs
- UnsafeMethods.cs
- SchemaDeclBase.cs
- RuntimeIdentifierPropertyAttribute.cs
- EnumerableRowCollection.cs
- TwoPhaseCommitProxy.cs
- DataListItem.cs
- HtmlEmptyTagControlBuilder.cs
- PrintPreviewControl.cs
- WeakHashtable.cs
- PopupControlService.cs
- ToolStripMenuItem.cs
- ExpressionBuilder.cs
- XmlDataLoader.cs
- MultiplexingDispatchMessageFormatter.cs
- CodeExpressionStatement.cs
- TypeConverterAttribute.cs
- ProfileBuildProvider.cs
- EmptyEnumerator.cs
- ReplyAdapterChannelListener.cs
- MsmqBindingElementBase.cs
- ListViewUpdateEventArgs.cs
- FastPropertyAccessor.cs
- NavigationService.cs
- PersistencePipeline.cs
- FloatUtil.cs