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

Consider eliminating the JavaFX-Launcher Thread

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • javafx
    • None

      Consider eliminating the JavaFX-Launcher Thread, and instead launch the FX toolkit / application thread directly from the caller.

      Gerard raised the question:

      > Does the start-up process really need the 2 threads #1 and #2?

      This might not be necessary. Having the JavaFX Launcher thread gives us the ability to set our own thread group. We don't use that capability, though, so we could consider retiring the thread and calling from the user's main thread. I would need to explore whether there are any issues with sandboxed application (I don't think so), or other concerns (such as what happens if the calling thread is a daemon thread, what happens if the user interrupts the main thread, etc). I 'm not sure this is worth pursuing, though. Both the Java main thread and the JavaFX-Launcher thread spend the entire life of the application asleep.

      Gerard later pointed out:

      > That might not matter much on Desktop platforms, but how expensive is a thread on a mobile platform, especially if we end up not using it?

      which is a valid point, so I am filing this issue to consider retiring the JavaFX-Launcher thread.

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Imported: