"Main Thread" slows down over time -- why?

While there are some other Topics dealing with FPS & “Main Thread”, this is a different subject.

Problem:
(1) Main Thread slows down SIGNIFICANTLY over time during flight
(2) It slows down, it does not ever speed up and recover to initial speed at start of flight.

This results in an ever decreasing FPS, during a flight, especially in flight over 30 minutes,

=========

As a user, I have really no idea WHY
As a professional programmer, I certainly have many GUESS

Of all the Current issues with MSFS, this should be one that Asobo should be able to easily reproduce, and debug.

I’m not going to go into details how they should do that .. they know… and unfortunatly, only they can determine what is the cause, as only they have the ability (tools/source) to examine the details of the “Main Thread”

I believe in the Developers panel, on the FPS display, the “Main Thread” is NOT a specific thread .. but is the thread that is currently taking the most time ??

As a user, we have no way of telling.

Maybe if it displayed the thread name, or (as a user Option) wrote to a log, we would have some visibility, and be able to submit that information to ZenDesk with a Bug report.

ie Is it the same for everyone, the same thread giving an issue, or is it different thread for different user’s configurations ?

Just knowing that should help greatly, finding the solution.

Maybe the user option to turn ON/OFF logging during a flight ?

1 Like

The “main thread” refers to a specific thread, that does specific things. Not just whichever thread is taking up the most time.

Can you tell me where you got that idea from ??

Just about every other discussion about Main Tread, talks about it being whichever thread is maxed out the most. ??

Then the question arises, what is that thread doing that is maxing it out so much more , later into a flight ??

Maybe I should be asking you how you ACCOUNT for your answer, if it does not TAX you to much to answer :stuck_out_tongue:

Standard software engineering practice. It wouldn’t be a “main thread” if it could be any thread at any moment.

In games, the “main thread” is virtually always the one that is tasked with running the game’s core game logic.

The “render thread(s)” are the ones that do the work of preparing and submitting frames to the GPU for rendering.

And other threads are usually just background I/O workers, that process work as it becomes available / needs to be done.

The code / thread that takes up the most time is referred to as the “hot path” not “main thread”

Yes .. wish you could go help Asobo sort all this out.

You obviously know what you are talking about…

Does not matter what you choose to call it, the question is – why does it take longer to execute over time ???

Whatever time it takes is basically just the time it takes to do what it needs to do. There are cases where the main thread (or any other thread) will have no choice but to halt and wait for some data to become available. Or to do a task that just takes more time than usual.

This is where it’s the developers job to try to optimize it as best as possible, given whatever constraints each thread may have.

Like, lets say that your frame rate is 60 FPS. That means that the CPU and GPU have to share 16 milliseconds per frame, to get everything done at a rate of 60 times per second. Then, if there is something that comes up, causing the main thread to take an extra 10 milliseconds for that one thing, that will appear as a distinct stutter, as 10ms is the majority of the total time it has per frame.

Yes (I now all this thanks) --but you are still failing to address the Topic of this tread)

WHY does the MAIN Thread slow down over time ..

Couldn’t say. That’s where Asobo has all of the specific implementation details that we just don’t have because we don’t work on the game. It might be possible to determine this from the outside, but that would take some pretty detailed CPU+GPU profiling, and may still not make the answer apparent. It is also possible (and likely) that the answer to this questions varies greatly from machine to machine, depending on software and hardware configuration.

I haven’t noticed continually worsening performance on my machine, but that doesn’t mean there isn’t a specific, concrete reason that it’s happening on another machine. This is part of the reason why PC development can be tricky. Unlikely consoles, there are virtually infinite combinations of software and hardware

Well, that’s the whole point of this “Thread” ( excuse the pun)

There SHOULD be no reason for threads to be running longer after 30 minutes into a flight, that they were, at the start of the flight (with the resulting slow down in Frame Rate)

That’s were the issue is.. that is what Asobo needs to look into, because the increasing time to execute the “Main Thread”, is a SYMPTOM of something that should not be going on.

That is what is being discussed, in the hope that enough will report this specific issue, that Asobo gives it some priority,

Right, that’s just the name of the game though. In a perfect world, everything should just work. But bugs exist. And in reality there are a gazillion reasons why a thread in a game could bog down over time. If it’s happening, it’s definitely a specific issue that exists and can be looked into.

Keep in mind that doing something like synchronizing a handful of threads, and hundreds of resources between them, to fit in a time of 16ms is among one of the most difficult and technical engineering challenges to begin with.

Nobody is suggesting that designing and debugging Multi Threaded real time systems is, to say the least, not Challenging. That’s why Microsoft is paying Asobo “the big bucks”.

Maybe some others do not see this affecting them so much, because they have faster systems, that can handle this increase in thread execution time, without it being so obvious.
But even they would probably see a decrease in frame rate over a long flight, if they ever did a long flight.

Those with more modest systems, can see the BUG more clearly, as it affect them sooner.

Its still a BUG, and it is an important one to correct, as it artificially limits the length of a flight.

You could consider that those seeing this on their slower machines, are the Heroes who will be the one’s to push more for a FIX.

Have you checked the temperature of your CPU while running msfs? It sounds like it might be getting too hot and thermal throttling.

LOl .. Yes … and closed and re-opend MSFS quickly, and with a new start, its back to initial fast speed.

But good point :slight_smile:

There is a profiling tool called GPUView. If you create a capture of the issue happening, As an engineer who works on this kind of thing, I can take a look at it, and see if I see any obvious signs or data, and can forward the analysis to Asobo.

GPUView captures the complex interactions between the CPU and GPU, as well as where the CPU and GPU are spending their time and what they are doing.

Basically the procedure would be to start the GPUView capture, and then start the sim, and do whatever you normally do that ends up with the main thread bogging down over time. All of the details of what’s happening will be in the capture.

Thank you so much –

Currently, I am re-installing Windows 1909 , because I upgraded to 2004, which have issues, and I then downgraded back to 1909. Not 100% sure that put be back to where I was before the update.

Have you actually tried GPUView with a release version of MSFS ?
There is a lot of copy protection in the release version, to stop “Snooping” into it !!!

It collects the data at the operating system level, rather than directly attaching to the game’s actual running process. For this reason there should be no issues capturing from it. I haven’t specifically tried it, I’ll test it out to make sure it works with the sim.

Thanks, it will be overnight before I get MSFS downloaded . (early night !!)

Hi Matt, I have this issue on every flight, I’ll be happy to send you a capture from the next flight.

This could also possibly be a memory leak.

Asobo should be able to quite easily see Memory leaks on their Development machines.