Hello! I was digging around online and heard something about multi-threaded game loops. Right now mine are single-threaded, and I wanted to know if multi-threading them is the way to go. And if it is, how would I do it?
- Async programming is generally faster than multithreading. Generalize both and you have parallelization.
- Parallelization is critical for server programming. For games, almost everything you write should be thread agnostic.
- Most hobbyist developers expressing interest in parallelization are more interested in the tech itself rather than the applied value.
- If your focus is really games, get your game mostly finished or at least playable. Then if you really want some extra runtime performance, try parallelization techniques.
- If you are really just more interested in threading/async tech than games, then go that direction: in the Java ecosystem I'd suggest understanding Future/Callable/ExecutorService really well. Then ForkJoinPool, understand the Scala extensions to Future/ExecutorService. Understand how you can use flatMap with a Future and then the for comprehension sugar. Understand async vs multithreading. Understand Akka.