WidescreenFixesPack icon indicating copy to clipboard operation
WidescreenFixesPack copied to clipboard

[NFSMW] Pin threads to single core (& rework the UG2 one a bit)

Open xan1242 opened this issue 2 years ago • 3 comments
trafficstars

Basically I had a bit of a misunderstanding what the thing from CrabJournal did (until I actually read the PR).

Anyhow, this should be done to improve game stability and performance.

Only the sound and main threads should be pinned, others are related to networking and shouldn't be touched unless necessary.

Maybe Carbon could use this too. Needs further testing.

xan1242 avatar Sep 25 '23 21:09 xan1242

Disabling "SingleCoreAffinity" (which should be renamed to something like "PinThreads" instead because it legitimately confused me with the Windows' process affinity) causes UG2 to crash somewhere during EAXSound::Update, so it's basically just as I suspected earlier (in another thread, can't find it) - the sound thread and main thread desync in some way and things go unstable.

So yeah, pinning main and sound threads onto their own CPU threads should do the trick.

xan1242 avatar Sep 25 '23 22:09 xan1242

Is there a way to tell which is which?

ThirteenAG avatar Sep 26 '23 02:09 ThirteenAG

Yeah, I can tell easily in the disassembly and the start locations of each CreateThread. Should be no problem.

xan1242 avatar Sep 26 '23 08:09 xan1242