Multithread object update in monogame?

how to implement Multithread object update in monogame?

You could do it the usual way as long as it is only in the update. But you have to have mechaniwm to tell update to wait for the threads to finish (autoresetevent for ex)

I’m guessing from the question that you haven’t done much multithreaded coding before. A common quote I recall when people talk about multithreading their code is

Some people, when confronted with a problem, think, "I know, I'll use threads!" Now they have ten problems.

The first question to ask is, what are you wanting to achieve?

I’m not saying you can’t use threading for your object updates. What I am saying is that it is not easy, and is not something anyone can answer properly or completely in a message forum post.

1 Like

I would say, go learn how to use Async first then come back to this question…

Actually… go learn C# and the .NET framework first… [You can get some books on these or use the link above] why does nobody do this? I have done it twice for C# and once for .NET… and I take the opportunity to recap them whenever documentation covers them just to keep updated on newer methods…

I even have a good fast reference C# book including an illustrated one that is more extensive…

This kind of question should be more directed at elements of MonoGame, less about the coding language…

But if you can be more specific about your issue/intention as mentioned already, we can probably help more that way instead of… shooting for the sky and hitting nothing…

Good Luck.