Recently my friend and I decided to start a small game project using LWJGL. We had a working game, but we were having issues where if a portion of the code started to slow down when under heavy processing. We decided to separate that into a thread so that it can run that on a seperate CPU and stop choking the rendering thread. After doing this, all of the swing processing starting acting totally weird. Upon launching the application all swing controls are running and my glcanvas is updating. The swing controls are totally functional up to this point. As soon as I try to click in the GLCanvas or press a key while the mouse is hovering over the glcanvas the Swing controls stop responding. None of the input will work inside the GLCanvas either. The glcanvas will continue to run, but cannot be interacted with. If at any point you try to drag the window it freezes everything and crashes. All of this happens whether or not the Inputs have been created. I've tried launching the threads inside a SwingWorker.invokelater method, but that didn't help.
Is this just a bad idea; trying to thread long running background processes? I know the overhead of context switching can be pretty heavy, but I was thinking it would be nice if you could start loading the next part of the map into the tree on the other unused processor, or maybe if the rendering thread started to bog down we could keep the physics thread updating at a usable pace. Is this a Swing thing? I'm starting to wonder if I'm creating an anti-pattern... Any insight will be greatly appreciated.