Tag Info

New answers tagged

3

I won't repeat why you should not use one thread per game entity, but if you truly want to use a simple-to-think-yet-efficient concurrent model, look for the actor model. In the actor model, you software is made of actors. Each actor is a parallel entity that you may think as a thread with state, even though it may be implemented differently. Each actor ...


2

Before you do anything read the first paragraph here First and foremost, running hundreds of threads isn't going to boost performance. It is going to instantly ruin your game. Why ? Because afaik in Windows and Linux the schedulers wakes up every millisecond (possibly more like 3) to check if another process needs to run. So if you have 50 tanks and 100 ...


10

Rule number one of multithreading: Don't even think about it, unless you really need to use multiple CPU cores for performance reasons*. Multithreading opens up a whole can of worms of obscure and impossible to reproduce bugs: Race conditions! Because you have no control over the thread scheduling of the OS, you have no control over the order in which ...


4

That sounds like a really bad idea. For multithreading to work well you need individual tasks that require significant computation, and can be easily segregated so that they don't work on the same dataset. There is an overhead to each new thread you use, there is in some cases a big overhead for shipping data between threads, and once you have occupied each ...



Top 50 recent answers are included