Need to pin when accessing thread container from virtual thread

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 25
    • Affects Version/s: 25
    • Component/s: core-libs
    • b23

      ThreadContainers are accessed by both virtual threads and carriers. If a virtual thread were to block/park and unmount then it could deadlock.

      Patricio observed the following stack trace for many threads when running Skynet, the threads are in the BLOCKED state.

      java.base/java.util.concurrent.ConcurrentHashMap.treeifyBin(ConcurrentHashMap.java:2691)
      java.base/java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1080)
      java.base/java.util.concurrent.ConcurrentHashMap$KeySetView.add(ConcurrentHashMap.java:4672)
      java.base/jdk.internal.vm.ThreadContainers$RootContainer$TrackingRootContainer.onStart(ThreadContainers.java:248)
      java.base/java.lang.VirtualThread.start(VirtualThread.java:710)
      java.base/java.lang.VirtualThread.start(VirtualThread.java:728)
      java.base/java.lang.ThreadBuilders$VirtualThreadBuilder.start(ThreadBuilders.java:262)

            Assignee:
            Alan Bateman
            Reporter:
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: