jediminer543 / JMT-MCMT

A multithreading mod for for Minecraft forge 1.15.2 and 1.16.x
https://www.curseforge.com/minecraft/mc-mods/mcmt-multithreading
BSD 2-Clause "Simplified" License
228 stars 18 forks source link

(Config & Documentation) Setting to blacklist certain threads of the CPU #59

Closed Mjrlun closed 3 years ago

Mjrlun commented 3 years ago

This would be especially useful for how optifine likes to use the 6th core (on a Ryzen 5 3600) specifically (from top-left to bottom-right, see image) for rendering.* Elsewise, better documentation within the config file would be useful, because the use of core as opposed to thread is used interchangeably (which is not correct). A core will equal one thread, if the CPU is not multithreaded. However, if this is the case, 1 core = 2 threads.

*(only applies to the r5 3600 to my knowledge, mileage might vary) image_2021-05-15_180057

Titaniumtown commented 3 years ago

Doesn't the OS handle what cores threads run on...?

And rendering happens on the GPU, not the CPU (unless you have no GPU).

KubiRemPL commented 3 years ago

What CPU is used etc is handled by OS itself. It is better to stay that way. The thing you can do is decrease threads used by MCMT in config if you really need it.

Mjrlun commented 3 years ago

If you read my suggestion, I'm asking the ability to blacklist certain CPU threads because of this issue. I asked nothing more.

Titaniumtown commented 3 years ago

Yea, but that's not how that works.

jediminer543 commented 3 years ago

I'm sorry but this is not possible to implement as there is no JVM wide standard that would let me perform thread pinning/process affining/etc,

My advice would be to edit the mod settings to be to

paraMaxMode = "Reduction"
paraMax = 1

That will always leave a thread free which will make sure the render thread can always schedule itself. I can also try and add a thing that will try to increase the priority of the render thread.