WearBlackAllDay / DimensionalThreading

An attempt to optimize the fabric server, by assigning each dimension their own thread.
MIT License
255 stars 22 forks source link

DimensionalThreading not able to assign threads above number of CPU cores #80

Open Krullin opened 1 year ago

Krullin commented 1 year ago

Hi, feel free to close/delete this if this is just me misunderstanding, but i don't know how else to ask this other than creating this Issue.

I have 4 cores available to me on my server, each with 2 threads, so that should give me up to 8 threads i can assign for Dimensional threading. However, if i try to assign any more than 4 threads using the "/gamerule dimthread_thread_count" the console tells me "Info: Integer must not be more than 4"

I tried this on a different server where i have 16 threads available, and then the integer is limited to 8 (number of cores).

I don't know if this something I'm doing wrong, if the server providers are limiting the cores i can actually access (server.pro for the 4 cores, ScalaCube for the 8 cores), if the command isn't assigning threads but cores, or if it's something else.

Again, I didn't know how else to ask and i didn't find any clarification in the DimThread description. Apologies for the inconvenience.

CaveNightingale commented 1 year ago

Simply replace Runtime.getRuntime().availableProcessors() with the maximum value you want, such as 8.

https://github.com/WearBlackAllDay/DimensionalThreading/blob/a9936bee4d74f5c00cef827b7c2983e561fa189f/src/main/java/wearblackallday/dimthread/init/ModGameRules.java#L18