Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Worker Threads

$
0
0

@HietpasGames wrote:

Hey,

This is a very vague and odd question. I've been debating about using threading. I'm a pro at threading, I use it all the time at work.

I have an expensive call that my DrawEngine is doing. It is doing some culling, pulling in what to draw, custom sorting it and more (My game has a lot of crap to draw, this is the best path I've found.) If the expensive call is done in the Monogame Update(), it is the biggest drag on the update loop. I've created one thread outside of the Game1 which can run this expensive method. There are no synchronization issues and no locking issues because of the way I've designed my game engine and draw engine. More or less the thread populates an array of what to draw. Timing/speed of the population doesn't matter, it can go faster than the update loop.

Running performance tests and timings. I am seeing an amazing performance boost.

Has anyone done something like this and regretted it later?

Thanks,
David

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles