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

Starting JVM from non-primordial thread breaks compatibility

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      A DESCRIPTION OF THE REQUEST :
      Dynamic libraries can be loaded by the virtual machine at run time, but they are unloaded by the kernel when the application ends.

      This means that static resources allocated by the DLL will be allocated in the current thread of the JVM at the point when the library is loaded, but disposed in the primordial thread when the kernel cleans up.

      Please supply a parameter to have the launcher create the JVM in the primordial thread to maintain compatibility, or somehow free the dynamically loaded libraries in the thread in which they were loaded.

      JUSTIFICATION :
      Deallocating resources in another thread than the one in which they were created is potentially dangerous and can cause corruption and crashes.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The destructors of static objects allocated in a DLL loaded on run time must be called from the same thread as the one which called their constructors.
      ACTUAL -
      The destructors are called from a different thread than the constructors.

      CUSTOMER SUBMITTED WORKAROUND :
      By not using the standard Java launcher, but instead writing your own, you can force the JVM to be loaded in the primordial thread.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ksrini Kumar Srinivasan
                Reporter:
                rmandalasunw Ranjith Mandala (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: