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

Threads::number_of_threads() is not 'MT-safe'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 11
    • 10
    • hotspot

      Threads::number_of_threads() is a plain _int_ but accessed sometimes like it was an atomic that never can go back to zero. Some use-cases are certainly suspicious and we must investigate if they can handle the raciness of this method. If you have Threads_lock this method behaves as intended, except it can go back to zero before VM has finished exiting. Which makes a check against zero also mean we are exiting.

      Most of the use cases wants to know if we have 'booted' and the other should probably use a (SMR) ThreadsList. So I suggest removing this method and create a new method for 'have VM booted'.

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

              Created:
              Updated:
              Resolved: