-
Mark authored
Thanks to no-defun-allowed for clueing me into that this would be somewhat easily done. When the underlying JVM supports virtual threads, :VIRTUAL-THREADS will be present in CL:*FEATURES*. The special variable THREADS:*THREADING-MODEL* contains the type of threads being spawned by the implementation: it will be :NATIVE for the default, which is usually a one-to-one mapping from each Java thread to a native thread, and will be :VIRTUAL if using the lightweight threads present in Project Loom JVMs. Tested on "OpenJDK_64-Bit_Server_VM-Oracle_Corporation-16-loom+9-316". Netbeans 12.2 has problems running the debugger with this change due to some sort of bad interaction with the JDWP protocol. Project Loom documentation of java.lang.Thread <https://download.java.net/java/early_access/loom/docs/api/java.base/java/lang/Thread.html> Overview of Project Loom <https://cr.openjdk.java.net/~rpressler/loom/loom/sol1_part1.html#migration-from-threads-to-virtual-threads> Early Access binaries for openjdk16-loom <https://jdk.java.net/loom/>
5baf7352