Page 1 of 1
Are layers seperately threaded?
Posted: Tue Oct 08, 2019 6:21 pm
by FrodoOf9Fingers
It was noted that modding will be the lifeblood of factorio after 1.0.
Given that, and seeing the trend for cpus is more cores, we may have to rely on Mods for performance bumps. Clusterio gave us mutlithreading, but that involves seperate instaces of factorio running. Itd be really cool if surfaces ran on seperate threads, for future modders to abuse for performance. Maybe even allow the threads to be out of sync tick wise.
Re: Are layers seperately threaded?
Posted: Tue Oct 08, 2019 6:42 pm
by eradicator
FrodoOf9Fingers wrote: Tue Oct 08, 2019 6:21 pm
Maybe even allow the threads to be out of sync tick wise.
I've had a totally absurd idea once involving several surface that run at different speeds. But that can never work if in an MP game there are players on both surfaces.
Mods can already make actions on one surface affect other surfaces (factorissimo) so you can't really treat them seperately without limiting what mods can do.
Re: Are layers seperately threaded?
Posted: Tue Oct 08, 2019 6:48 pm
by DaveMcW
The single-thread design is only one of the bottlenecks. RAM latency is another one, sometimes even the
primary bottleneck.
If you solve multithreading, you will still be stuck on RAM latency.
Re: Are layers seperately threaded?
Posted: Tue Oct 08, 2019 7:15 pm
by Cribbit
It's a wonderfully complex problem but not an impossible one.
I'm curious if it's possible to identify and define distinct blocks of area and put each area on its own thread. For example, train pathing probably doesn't need to be on the same thread as inserters deciding to take items.
Re: Are layers seperately threaded?
Posted: Tue Oct 08, 2019 7:27 pm
by FrodoOf9Fingers
Cribbit wrote: Tue Oct 08, 2019 7:15 pm
It's a wonderfully complex problem but not an impossible one.
I'm curious if it's possible to identify and define distinct blocks of area and put each area on its own thread. For example, train pathing probably doesn't need to be on the same thread as inserters deciding to take items.
This is within a surface. I'm not going to contest having only a single thread per surface, because there are tons of dependencies within a surface. Id like to see one thread per surface.
Re: Are layers seperately threaded?
Posted: Tue Oct 08, 2019 7:29 pm
by Klonan
Different surfaces still have the same problem with threading as anything else
The main thing I see, is that scripts can access any surface. So when an entity dies, a script could add/remove other things from other surfaces
Re: Are layers seperately threaded?
Posted: Tue Oct 08, 2019 7:31 pm
by FrodoOf9Fingers
DaveMcW wrote: Tue Oct 08, 2019 6:48 pm
The single-thread design is only one of the bottlenecks. RAM latency is another one, sometimes even the
primary bottleneck.
If you solve multithreading, you will still be stuck on RAM latency.
The hope is that hardware will improve. Memory overclocking is becoming more widespread, and there are sure to be other ways to increase the speed with new chipset designs.
I'm planning for better hardware, and hoping factorio will be able to use it, even if it's not all used on a single surface.
Re: Are layers seperately threaded?
Posted: Tue Oct 08, 2019 7:35 pm
by FrodoOf9Fingers
Klonan wrote: Tue Oct 08, 2019 7:29 pm
Different surfaces still have the same problem with threading as anything else
The main thing I see, is that scripts can access any surface. So when an entity dies, a script could add/remove other things from other surfaces
Thats true. Putting multi threaded programming concerns on mod devs would be... Fun?