For observability reasons, virtual threads created directly with the Thread API need to be tracked (the so called "root container"). For JDK 21, this is a CHM which adds overhead to virtual thread create and termination time. TPTE and ThreadFlock also keep references to Threads in a CHM.
At least for the root container, this could be implemented with a lock free list of virtual threads.
At least for the root container, this could be implemented with a lock free list of virtual threads.