freeze again :-(

2005-09-27
2013-04-08
  • George Tryfon
    George Tryfon
    2005-09-27

    Hello

    Touchgraph freezes when I use it with JRE 1.5 and Swing.
    Then I can only terminate the application from the console.

    Does anybody use Touchgraph with JRE 1.5 and Swing, without the freeze problem?

    Thank you

     
    • bobruney
      bobruney
      2005-10-14

      Somebody once posted a solution for this problem.

      It was something like running the renderer in its own thread, though im not sure.

      Somebody also said, recompiling Touchgraph under Java 5 would work, but doesnt work for me.

      Has anybody come up with a solution on how to get Touchgraph running under 1.5 and would might want to share it with us?

      Its a shame, that it looks like Touchgraph will die, if no Java 1.5 support is implemented.

       
    • mksheoran
      mksheoran
      2005-10-17

      Hi George,
      I am working propertly with 1.5. There was a deadloack issue on 1.5 but I get rid from that by making some changes in TG API.

      >Its a shame, that it looks like Touchgraph will die, if no Java 1.5 support is implemented.
      In my opinion, It will not die.

      --Manoj Kr. Sheoran

       
      • whof
        whof
        2005-10-17

        Can you please post your fix?  I have the same freezing issue and recompiling under 1.5 does not fix it.  I may eventually switch to JUNG or Prefuse but I need at least a short term fix since I am using TouchGraph in a production application.

         
    • mksheoran
      mksheoran
      2005-10-19

      Hi folks,
      Everybody know about the Java 5+ TG deallock problem. I get rid from it at my end and solution made by me is:-

      1. Open  HVScroll.DScrollbar class in TG source
      2. Avoid call of super in setIvalue maethod and write your own code for that. Becuase lock occurs over here.

      public int getValue(){
                  return val;           
              }
             
              public void setValue(int v) { doubleValue = v; super.setValue(v); }
              private int val=0;
              public void setIValue(int v) {
      //            super.setValue(v);
                  this.val=v; 
              }

      Hope it will help you.

       
      • whof
        whof
        2005-10-24

        Thanks!  This seems to work.  I wonder how to get this patch into the main source distribution?

         
      • bobruney
        bobruney
        2005-10-28

        Hi,

        this was just what I was waiting for (i didnt have a clue on what the deadlock might have its root at).

        Thank you very much, for sharing the code!

        Ive tested Touchgraph for the last 30 minutes with Java 5 and it worked.

        Thanks!

         
      • Edward Glen
        Edward Glen
        2005-11-11

        Thanks for the fix!... I was getting frustrated trying to locate the problem.

        If you're ever in Vancouver BC, send me a message.. I'll show you around town :)

         
    • mksheoran
      mksheoran
      2005-10-27

      I think issue is not that is located by me but issue is somewhere else it's just a JUGAAD.  There should not be a deadlock condition at all but happening and quite wrong. I thing provision can be maid in TGLayout.relax and etc but still need to drill-down more and hope Alex can help us better for the same.

       
    • mksheoran
      mksheoran
      2005-11-04

      Hi,
      Do you think TG is capable to handle thousands of nodes?   Have you tested it with thousand of nodes?

      Regards,
      Manoj

       
    • I've just fixed a problem that caused a deadlock. TouchGraph uses several threads to update the GUI. This is not allowed in Swing, so several threads ended up locking on the TGPanel instance and the AWT objects. The patch below delegates all GUI repainting to the Swing thread, and thus avoids deadlock. The GUI is a *lot* faster with this patch too. :)

      Index: com/touchgraph/graphlayout/TGLayout.java

      RCS file: /cvsroot/touchgraph/src/com/touchgraph/graphlayout/TGLayout.java,v
      retrieving revision 1.20
      diff -r1.20 TGLayout.java
      52a53
      > import javax.swing.SwingUtilities;
      321c322,326
      <         tgPanel.repaintAfterMove();
      ---
      >     SwingUtilities.invokeLater(new Runnable() {
      >             public void run() {
      >           tgPanel.repaintAfterMove();
      >         }
      >       });
      Index: com/touchgraph/graphlayout/LocalityUtils.java
      ===================================================================
      RCS file: /cvsroot/touchgraph/src/com/touchgraph/graphlayout/LocalityUtils.java,v
      retrieving revision 1.16
      diff -r1.16 LocalityUtils.java
      54a55
      > import javax.swing.*;
      224c225
      <         new Thread() {
      ---
      >       SwingUtilities.invokeLater(new Runnable() {
      250c251
      <         }.start();
      ---
      >         });
      256c257
      <         new Thread() {
      ---
      >         SwingUtilities.invokeLater(new Runnable() {
      277c278
      <         }.start();
      ---
      >         });
      283c284
      <         new Thread() {
      ---
      >         SwingUtilities.invokeLater(new Runnable() {
      303c304
      <         }.start();
      ---
      >         });
      Index: com/touchgraph/graphlayout/interaction/HVScroll.java
      ===================================================================
      RCS file: /cvsroot/touchgraph/src/com/touchgraph/graphlayout/interaction/HVScroll.java,v
      retrieving revision 1.22
      diff -r1.22 HVScroll.java
      291c291
      <          Thread scrollThread = new Thread() {
      ---
      >          Runnable scrollThread = new Runnable() {
      322c322
      <         scrollThread.start();
      ---
      >     SwingUtilities.invokeLater(scrollThread);