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

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • 11
    • Affects Version/s: 10
    • Component/s: 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'.

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

              Created:
              Updated:
              Resolved: