hello,
i have a 3d game running with jogl. apparently jogl has it’s own thread, which tries to run as fast as possible.
and i have another thread that prepares ressources like textures for the main jogl thread. if the ressources are ready, the jogl thread can pick them up.
edit: what this ressource thread does, is mainly merging several texture-layers (bufferedimages) into one.
now all this works fine on CPUs that have some kind of multithreaded optimization like the Intel HyperThreading or Intel Dual Core CPUs.
but on normal, “single-threaded” CPUs the jogl-thread becomes extremely stuttery and slow whenever the ressource thread has something to do.
i believe the problem is, that both threads need almost 100% of the cpu and on these single-threaded CPUs that is not possible.
i am working on this problem now for almost a month and i am pretty sure i can rule out garbage collection and blocking (synchronized ressources) to be the cause for this.
now i guess my game is not the only one that does some extra work in another thread, so my question to you guys is, how do you handle this problem in your games, while keeping the main rendering thread at a constant frame rate?
thanks a lot!