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

Enforce Fx Threading

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • tbd
    • fx2.0
    • javafx

    Description

      Java Fx is apartment threaded but the threading model is not enforce everywhere in the API. This means that the toolkit can become internally unstable and that application code may behave erratically. Other modern widget toolkits, such as WPF enforce threading at the API level and throw an exceptions when an object is accessed from the wrong thread.

      This JIRA issue is the start of the discussion, but API will be needed to:

      - check access to an object (ie. Node.checkAccess())
      - determine the thread that controls an object (ie. Node.getThread())
      - hand off an object created in one thread over to another

      In the simple examples, I used Node as the root class but many classes in Fx derive from Object. I suggest that Fx objects that are thread aware derive from a common base class. Dependency objects are also affected. As discussed, an dependency object that is UI aware might be necessary.

      Note that this change is quite pervassive as it will touch all public API.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              snorthov Steve Northover (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Imported: