mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-13 14:19:12 +00:00
Only assign physicalCoreCount when needed.
This commit is contained in:
parent
b5cb5c83fa
commit
f9ec040ca5
1 changed files with 4 additions and 2 deletions
|
@ -57,6 +57,8 @@ namespace ARMeilleure.Translation
|
||||||
|
|
||||||
private Thread[] _backgroundTranslationThreads;
|
private Thread[] _backgroundTranslationThreads;
|
||||||
private volatile int _threadCount;
|
private volatile int _threadCount;
|
||||||
|
private static int physicalCoreCount;
|
||||||
|
|
||||||
|
|
||||||
// FIXME: Remove this once the init logic of the emulator will be redone.
|
// FIXME: Remove this once the init logic of the emulator will be redone.
|
||||||
public static readonly ManualResetEvent IsReadyForTranslation = new(false);
|
public static readonly ManualResetEvent IsReadyForTranslation = new(false);
|
||||||
|
@ -104,8 +106,6 @@ namespace ARMeilleure.Translation
|
||||||
|
|
||||||
public void Execute(State.ExecutionContext context, ulong address)
|
public void Execute(State.ExecutionContext context, ulong address)
|
||||||
{
|
{
|
||||||
int physicalCoreCount = SystemInfo.GetPhysicalCoreCount();
|
|
||||||
|
|
||||||
if (Interlocked.Increment(ref _threadCount) == 1)
|
if (Interlocked.Increment(ref _threadCount) == 1)
|
||||||
{
|
{
|
||||||
IsReadyForTranslation.WaitOne();
|
IsReadyForTranslation.WaitOne();
|
||||||
|
@ -120,6 +120,8 @@ namespace ARMeilleure.Translation
|
||||||
_ptc.Profiler.Start();
|
_ptc.Profiler.Start();
|
||||||
|
|
||||||
_ptc.Disable();
|
_ptc.Disable();
|
||||||
|
|
||||||
|
physicalCoreCount = SystemInfo.GetPhysicalCoreCount();
|
||||||
|
|
||||||
// Simple heuristic, should be user configurable in future. (1 for 4 core/ht or less, 2 for 6 core + ht
|
// Simple heuristic, should be user configurable in future. (1 for 4 core/ht or less, 2 for 6 core + ht
|
||||||
// etc). All threads are normal priority except from the last, which just fills as much of the last core
|
// etc). All threads are normal priority except from the last, which just fills as much of the last core
|
||||||
|
|
Loading…
Reference in a new issue