public ConcurrentMultiDataEnumerator(IList <IDataEnumerator> enumerators, int enumeratorLoadFetchSize, int threadPoolSize) { _enumerators = enumerators; _threadPoolSize = threadPoolSize; _enumeratorLoadFetchSize = enumeratorLoadFetchSize; _sharedState = new EnumerateTaskSharedState(enumerators.Count); }
public LinkableLinkedListBlockingEnumerator(EnumerateTaskSharedState sharedState) { this.sharedState = sharedState; while (currentPositionNode == null) { lock (sharedState.syncObject) { //Check for any exception thrown by the task executers if (sharedState.exceptionOccured != null) { throw sharedState.exceptionOccured; } //Create first node when the accumulated list has elements if (sharedState.accumulatedEnumeratedObjectList.First != null) { currentPositionNode = new LinkableLinkedListNode(null); currentPositionNode.Next = sharedState.accumulatedEnumeratedObjectList.First; } //If all enumerators are done or enumerator is disposed, break else if (sharedState.allEnumeratorsDone || sharedState.disposed) { break; } //If there are no elements in the list yet block until status changed else { Monitor.Wait(sharedState.syncObject); } } } }
public ConcurrentMultiDataEnumerator(IList<IDataEnumerator> enumerators, int enumeratorLoadFetchSize, int threadPoolSize) { _enumerators = enumerators; _threadPoolSize = threadPoolSize; _enumeratorLoadFetchSize = enumeratorLoadFetchSize; _sharedState = new EnumerateTaskSharedState(enumerators.Count); }
public ConcurrentMultiDataEnumerator(ICollection<IDataEnumerator> internalDataEnumerators, int batchSize, int threadPoolSize) { _batchSize = batchSize; _threadPoolSize = threadPoolSize; _internalDataEnumerators = internalDataEnumerators; _sharedState = new EnumerateTaskSharedState(_internalDataEnumerators.Count); }
public ConcurrentMultiDataEnumerator(ICollection <IDataEnumerator> internalDataEnumerators, int batchSize, int threadPoolSize) { _batchSize = batchSize; _threadPoolSize = threadPoolSize; _internalDataEnumerators = internalDataEnumerators; _sharedState = new EnumerateTaskSharedState(_internalDataEnumerators.Count); }
public LinkableLinkedListBlockingEnumerator(EnumerateTaskSharedState sharedState) { this.sharedState = sharedState; while (currentPositionNode == null) lock (sharedState.syncObject) { //Check for any exception thrown by the task executers if (sharedState.exceptionOccured != null) throw sharedState.exceptionOccured; //Create first node when the accumulated list has elements if (sharedState.accumulatedEnumeratedObjectList.First != null) { currentPositionNode = new LinkableLinkedListNode(null); currentPositionNode.Next = sharedState.accumulatedEnumeratedObjectList.First; } //If all enumerators are done or enumerator is disposed, break else if (sharedState.allEnumeratorsDone || sharedState.disposed) break; //If there are no elements in the list yet block until status changed else Monitor.Wait(sharedState.syncObject); } }
public EnumerateTask(EnumerateTaskSharedState sharedState, int batchSize, IEnumerator enumerator) { this.sharedState = sharedState; this.enumerator = enumerator; this.batchSize = batchSize; }