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

Thread.sleep() does not work as expected in Solaris.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.2, 1.4.2
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      linux, solaris_8

      Description


      The sleep function does not accuratly block for the specified
      milliseconds.

      please try the program listed below :

      *********** timeTest.java ****************

      class timeTest
      {

              public static void main(String[] args)
              {

                      long start = System.currentTimeMillis();

                      for(int i = 0;i < 1000;i++) {

                              try {
                              Thread.sleep(1);
                              } catch( InterruptedException ex) {}
                      }

                      long stop = System.currentTimeMillis();

                      System.out.println(" Time taken : " + (stop - start));
              }
      }

      **********************************************

      on running this program in Solaris 8 & Solaris 7 with jdk1.2.2

      the program prints a result of 19992 milliseconds.

      on windows NT, I get the correct expected result of 1002 milliseconds.

      I get varying results with other JDK's ( with 1.3 it took 10003 ms)
      in Solaris.

      clearly the sleep function is broken for the solaris environment
      as it does not block accuratly for the specified time.

      balaji.raghunathan@eng 2000-09-21

      Thread.sleep() for nano seconds time interval does not work too.

      Thread.sleep() simply does not timeout properly for any given
      time interval. This could be a very serious problem in all Java
      based server software for the Solaris platform. note: it works ok in
      Windows NT and that makes this bug even more important to fix.




        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              duke J. Duke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: