javaproject-loomvirtual-threads

How to enable fibers for the early release of the jdk-16 loom?


I've downloaded the early release version from https://jdk.java.net/loom/ and java starts but doing Class.forName("java.lang.Fiber") and Class.forName("java.lang.FiberScope") doesn't work. Is there a flag/jar that needs to be included?


Solution

  • The term "fiber" seems to have been changed to "virtual thread".

    See 2020-10 interview with Brian Goetz, at 31:00 on YouTube where he mentions the name change.

    Look in the early-access Java 16 Javadoc for things like Thread.VirtualThreadTask.

    See virtual threads terminology used in JEP draft: Re-implement ThreadGroup, created 2020-09-07.

    See code discussed in this 2020-05 article making calls like Thread.startVirtualThread. [May be out-of-date, I do not know.]