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

LockSupport.park with large timeout overflows, causing immediate return, resulting in busy-poll loop

    XMLWordPrintable

Details

    • b82
    • generic
    • solaris

    Description

      If a very long timeout is passed to a blocking method (such as java.util.concurrent.LinkedBlockingQueue.poll) that ultimately uses LockSupport.park, the park call returns immediately instead of suspending the thread. Because park is allowed to return spuriously, the calling code always loops checking the condition it was waiting for and recalling park. This results in a busy-wait loop as the method constantly recalls park, which keeps returning immediately.

      Attachments

        Issue Links

          Activity

            People

              dholmes David Holmes
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: