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

Asynchronous handshakes without specific target

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 20
    • hotspot

      The VM have several cases of work which must be done in a JavaThread but cannot, for different reasons, be done here and now.
      Today the common solution is to add that piece of work to the ServiceThread.
      The problem with putting all work on a single thread is:
      - Work cannot be executed in parallel.
      - In certain situations there can be contention on Service_lock.
      - There is no way for the user to know how much CPU the ServiceThread will require, thus over- or under-provision the machine.

      If we could use fire-and-forget handshakes that had an guarantee to be execute by one or more JavaThreads, this could be a good alternative.

      For the simplest case using a AsyncHandshakeClosure but without a target, for the more complex case, were only a small piece of the work is executed in each handshake, a new type of async handshake is needed.

      Since this handshake types needs execution guarantee we probably need to to have a fallback.
      Firing the handshake, setting a timeout for the VMThread/ServiceThread, if the handshake is not done before timeout, the VMThread/ServiceThread will make sure this work is completed. It could move the work to a another JT, it could use ServiceThread/self as fallback, etc...

            Unassigned Unassigned
            rehn Robbin Ehn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: