AWTCanvas not updating when SwingThread is under heavy load.

Started by Mr_Chaos, August 07, 2017, 08:18:56 PM

Previous topic - Next topic

Mr_Chaos

I have a strange problem, normally my program runs fine, but when the EDT thread in under heavy load the AWTCanvas freezes.

The SwingUI is updated, but the AWTCanvas is not.

Has anyone seen anything like this before ?


    buffer.clear(frameBufferBGColor);
    world.renderScene(buffer);
    world.draw(buffer);
   
    buffer.update();
       
    buffer.displayGLOnly();
   
   _canvas.repaint();


EgonOlsen

Not really. How exactly do you define "heavy load" for the EDT?

Mr_Chaos

Quote from: EgonOlsen on August 08, 2017, 05:16:54 PM
Not really. How exactly do you define "heavy load" for the EDT?

That's a good question, we have a table (Jide) which is updated many times each second, and if we sort the table, suddenly the awtcanvas stops updating, but the Swing table still updates

EgonOlsen

That's strange, because they should be in the same thread. Have you checked if they actually are? It is possible to work with different EDT's for different components (albeit that's a pain in the a... but some people won't listen...).

Or...maybe the table is sorted in the EDT, i.e. actually blocking it while doing the repaints by itself?

Mr_Chaos

Quote from: EgonOlsen on August 09, 2017, 10:28:33 AM
That's strange, because they should be in the same thread. Have you checked if they actually are? It is possible to work with different EDT's for different components (albeit that's a pain in the a... but some people won't listen...).

Or...maybe the table is sorted in the EDT, i.e. actually blocking it while doing the repaints by itself?

It's very strange, because all other swing components also still update (we have a JTextField with the current time, and it updates fine).

Any idea how I could debug it ?

EgonOlsen

You could add an IPaintListener implementation. When used on an AWTGLRenderer, it will be called in the EDT. If that doesn't happen, there's no update being called. If it is, then there's an update but no actual render output.