Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4511530

Regression: Ctrl-C a large multi-threaded program very slow (Linux)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.1
    • 1.4.0
    • hotspot
    • hopper
    • generic
    • linux

      Run an application that creates a lot of threads, and press "Ctrl-C" to stop it.
      e.g. try to "Ctrl-C" the following program:

      class t{
        public static void main(String []args){
          try{
            for(int i=0; i< 800; i++){
              Thread t = new Thread(){
                public void run(){
                  try{
                    System.out.println(getName());
                    sleep(100000);
                  }catch(Exception e){}
                }
              };
              t.start();
            }
          }catch(Throwable t){
            t.printStackTrace();
      // System.exit(1);
          }
          System.out.println("Press Ctrl-C please...");
        }
      }

      On my Linux system (Redhat 7.1 SMP on dual PIII-866), with Merlin b83,
      Ctrl-C takes 29 seconds to finish!

      Handling Ctrl-C should be quick.

      Update:
      It's reasonably fast using JDK-1.3.1 or 1.4-beta (by "reasonably fast",
      I mean up to 5 seconds). 1.4-beta2 needs 20-30 seconds to finish Ctrl-C.

            hhuangsunw Hui Huang (Inactive)
            hhuangsunw Hui Huang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: