Are layers seperately threaded?

Post all other topics which do not belong to any other category.
Post Reply
FrodoOf9Fingers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sat Apr 29, 2017 11:13 pm
Contact:

Are layers seperately threaded?

Post 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.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Are layers seperately threaded?

Post 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.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Are layers seperately threaded?

Post 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.

Cribbit
Fast Inserter
Fast Inserter
Posts: 199
Joined: Mon Oct 09, 2017 9:35 pm
Contact:

Re: Are layers seperately threaded?

Post 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.

FrodoOf9Fingers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sat Apr 29, 2017 11:13 pm
Contact:

Re: Are layers seperately threaded?

Post 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.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Are layers seperately threaded?

Post 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

FrodoOf9Fingers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sat Apr 29, 2017 11:13 pm
Contact:

Re: Are layers seperately threaded?

Post 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.

FrodoOf9Fingers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sat Apr 29, 2017 11:13 pm
Contact:

Re: Are layers seperately threaded?

Post 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?

Post Reply

Return to “General discussion”