Author Topic: AWTCanvas not updating when SwingThread is under heavy load.  (Read 289 times)

Offline Mr_Chaos

  • int
  • **
  • Posts: 55
    • View Profile
AWTCanvas not updating when SwingThread is under heavy load.
« on: August 07, 2017, 08:18:56 pm »
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 ?

Code: [Select]
    buffer.clear(frameBufferBGColor);
    world.renderScene(buffer);
    world.draw(buffer);
   
    buffer.update();
       
    buffer.displayGLOnly();
   
   _canvas.repaint();


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: AWTCanvas not updating when SwingThread is under heavy load.
« Reply #1 on: August 08, 2017, 05:16:54 pm »
Not really. How exactly do you define "heavy load" for the EDT?

Offline Mr_Chaos

  • int
  • **
  • Posts: 55
    • View Profile
Re: AWTCanvas not updating when SwingThread is under heavy load.
« Reply #2 on: August 08, 2017, 10:15:10 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: AWTCanvas not updating when SwingThread is under heavy load.
« Reply #3 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?
« Last Edit: August 09, 2017, 10:30:18 am by EgonOlsen »

Offline Mr_Chaos

  • int
  • **
  • Posts: 55
    • View Profile
Re: AWTCanvas not updating when SwingThread is under heavy load.
« Reply #4 on: August 09, 2017, 07:14:41 pm »
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 ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: AWTCanvas not updating when SwingThread is under heavy load.
« Reply #5 on: August 13, 2017, 06:26:54 pm »
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.