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

Change virtual Thread.yield to use external submit

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 20
    • None
    • core-libs
    • None
    • b27

    Description

      Thread.yield is currently implemented as "lazy submit" and is unfair when virtual threads are waiting in submission queues (started or unmarked by platform threads.

      The issue tracks changing the implementation to check the local queue. If empty, use external submit, other use a regular submit. The effect will be improve fairness and release the carrier as users of Thread.yield will expect. The downside is that virtual threads may bounce between carriers.

      Attachments

        Issue Links

          Activity

            People

              alanb Alan Bateman
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: