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

Need to pin when accessing thread container from virtual thread

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • 25
    • core-libs

      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)

            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: