protected override void ExecuteOnCore(int coreIndex, PairingData <PartType, GlobalDataType> calculationPair) { new Thread( () => { CalculationLogic.Calculate(calculationPair); ResetEvents[coreIndex].Set(); } ).Start(); }
protected override void ExecuteOnCore(int coreIndex, PairingData <PartType, GlobalDataType> calculationPair) { ThreadCalculationData data = new ThreadCalculationData() { m_pair = calculationPair, m_resetEvent = ResetEvents[coreIndex] }; ThreadPool.QueueUserWorkItem(CalculationCallback, data); }
public void Calculate(PairingData <PartType, GlobalDataType> pair) { if (m_pairFunction == null) { throw new Exception("Calculation function not initialized."); } if (pair.CalculateInternally) { CalculateStackInternal(pair.Stack1, pair.GlobalData); CalculateStackInternal(pair.Stack2, pair.GlobalData); } CalculateStackPair(pair.Stack1, pair.Stack2, pair.GlobalData); }
public override void CalculatePairedData(PairingData <PartType, GlobalDataType> calculationPair) { m_resource = calculationPair; m_lock.Release(); }
public abstract void DistributeCalculation(int coreIndex, PairingData <PartType, GlobalDataType> calculationPair);
protected abstract void ExecuteOnCore(int coreIndex, PairingData <PartType, GlobalDataType> calculationPair);
sealed public override void DistributeCalculation(int coreIndex, PairingData <PartType, GlobalDataType> calculationPair) { ResetEvents[coreIndex].Reset(); ExecuteOnCore(coreIndex, calculationPair); }