Example #1
0
 protected override void ExecuteOnCore(int coreIndex, PairingData <PartType, GlobalDataType> calculationPair)
 {
     new Thread(
         () =>
     {
         CalculationLogic.Calculate(calculationPair);
         ResetEvents[coreIndex].Set();
     }
         ).Start();
 }
Example #2
0
        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);
        }
Example #4
0
 public override void CalculatePairedData(PairingData <PartType, GlobalDataType> calculationPair)
 {
     m_resource = calculationPair;
     m_lock.Release();
 }
Example #5
0
 public abstract void DistributeCalculation(int coreIndex, PairingData <PartType, GlobalDataType> calculationPair);
Example #6
0
 protected abstract void ExecuteOnCore(int coreIndex, PairingData <PartType, GlobalDataType> calculationPair);
Example #7
0
 sealed public override void DistributeCalculation(int coreIndex, PairingData <PartType, GlobalDataType> calculationPair)
 {
     ResetEvents[coreIndex].Reset();
     ExecuteOnCore(coreIndex, calculationPair);
 }