Max Threads. How much, why?

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
MtNak
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Fri May 16, 2014 4:03 pm
Contact:

Max Threads. How much, why?

Post by MtNak »

I don't know a lot about computers yet and i read several times that i have to put Max Threads (in Options/other) as the same number of cores mi cpu has.
Then some people say this is not correct because of multithreading or virtual cores. Things i don't understand.

Could someone clarify this for me?
My cpu is: AMD FX-6100 Six Core

Do i have to put "Max Threads: 6"? Why?

As i couldn't find it on the forums, it would be nice if you could explain how does this work for most people, as some others may have this question but not the same cpu.

Thanks! :)

starxplor
Fast Inserter
Fast Inserter
Posts: 164
Joined: Sun May 18, 2014 11:25 pm
Contact:

Re: Max Threads. How much, why?

Post by starxplor »

Assuming these are not processes but are threads(sometimes called lightweight processes), it really doesnt matter with that CPU. you could put 6, or even 10 and probably not notice much difference. THe biggest impact is 1->2-4. beyond that, you have to add A LOT more threads and have a very very busy base for it to matter with modern CPUs, like yours.

I personally have a similar hex-core processor and run with 6 threads with no perceivable difference between 6, or 4, and 6 or 8.

Blackence
Fast Inserter
Fast Inserter
Posts: 109
Joined: Thu Jun 05, 2014 4:03 pm
Contact:

Re: Max Threads. How much, why?

Post by Blackence »

As MtNak explained, it rarely hurts to have a few more threads than your CPU can handle concurrently. Your operating system will automatically switch between them if you have more active threads than CPU cores, so don't worry about it too much. On the other hand, if you set this to a small number (like 1 for example), the game can only use that many CPU cores (so only 1 out of your 6 cores in that case). If you set it to 12 (is that possible with factorio?), there will be 2 threads per CPU core, so half of the threads will be paused for a very short time while letting the other threads work, and then the paused threads will be allowed to use the CPU and the previously active threads are forced to wait. Most of the time, you won't notice the slow-down caused by those "context switches" when a CPU core needs to switch to a different thread and almost the same amount of work is done in a given timeframe.

I'd even argue that factorio should use something like n or 2*n threads (n = number of threads the CPU is able to execute concurrently) and not confuse the user with a max threads setting. Unless factorio is built with C++11 it's probably too much work to find a portable solution, so maybe just default to something like 8 and hide the GUI option, but keep a config file option… :mrgreen:

starxplor
Fast Inserter
Fast Inserter
Posts: 164
Joined: Sun May 18, 2014 11:25 pm
Contact:

Re: Max Threads. How much, why?

Post by starxplor »

Or add to the tooltip something like "only change this if you are trying to fix a problem".

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Max Threads. How much, why?

Post by ssilk »

It makes of course sense, that the game is free to use as many threads as it needs. But in some cases it is eventually useful, to have only one. For me this is more or less a debugging option and should be left untouched, cause not needed.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

MtNak
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Fri May 16, 2014 4:03 pm
Contact:

Re: Max Threads. How much, why?

Post by MtNak »

Thank you very much for the replies :)

Post Reply

Return to “Technical Help”