Libgdx as we know is a java framework, and java supports multi threading programming. For desktop and android target, it should runs fine because the environment support for multi threading. But I wonder how Libgdx (or maybe, more appropriately, gwt) translate the code to javascript, for as far as I know javascript has no support for multi thread. Suppose I adds some logic that leverage the capability of multithreading, would it runs correctly on the html target?
Asked
Active
Viewed 187 times
1 Answers
2
LibGDX does not support it for gwt. From https://github.com/libgdx/libgdx/wiki/Threading "JavaScript is inherently single-threaded. As such, threading is impossible. Web Workers might be an option in the future, however, data is passed via message passing between thread.".
In some cases you can write the platform specific code (https://github.com/libgdx/libgdx/wiki/Interfacing-with-platform-specific-code) and for gwt platform use Schaduler (Threading in GWT (Client)).

MatejC
- 2,167
- 1
- 18
- 25