Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ LogTransition()

void System.Threading.PortableThreadPool.HillClimbing.LogTransition ( int newThreadCount,
double throughput,
StateOrTransition stateOrTransition )
inlineprivate

Definition at line 604 of file PortableThreadPool.cs.

605 {
606 int num = (_logStart + _logSize) % 200;
607 if (_logSize == 200)
608 {
609 _logStart = (_logStart + 1) % 200;
610 _logSize--;
611 }
612 ref LogEntry reference = ref _log[num];
613 reference.tickCount = Environment.TickCount;
614 reference.stateOrTransition = stateOrTransition;
615 reference.newControlSetting = newThreadCount;
616 reference.lastHistoryCount = (int)(Math.Min(_totalSamples, _samplesToMeasure) / _wavePeriod) * _wavePeriod;
617 reference.lastHistoryMean = (float)throughput;
618 _logSize++;
619 if (NativeRuntimeEventSource.Log.IsEnabled())
620 {
621 NativeRuntimeEventSource.Log.ThreadPoolWorkerThreadAdjustmentAdjustment(throughput, (uint)newThreadCount, (NativeRuntimeEventSource.ThreadAdjustmentReasonMap)stateOrTransition, 0);
622 }
623 }

References System.Threading.PortableThreadPool.HillClimbing._log, System.Threading.PortableThreadPool.HillClimbing._logSize, System.Threading.PortableThreadPool.HillClimbing._logStart, System.Threading.PortableThreadPool.HillClimbing._samplesToMeasure, System.Threading.PortableThreadPool.HillClimbing._totalSamples, System.Threading.PortableThreadPool.HillClimbing._wavePeriod, System.Diagnostics.Tracing.NativeRuntimeEventSource.Log, System.Math.Min(), System.Threading.PortableThreadPool.HillClimbing.newThreadCount, and System.Environment.TickCount.

Referenced by System.Threading.PortableThreadPool.HillClimbing.ChangeThreadCount().