3 ms·
The JVM will still create an OS thread by the default way. You have to explicitly create virtual threads to use loom.
by kaba0 5y ago
The JVM will still create an OS thread by the default way. You have to explicitly create virtual threads to use loom.
- pjmlp 5y agoUnless they changed the behaviour, that wasn't the case last time I checked a talk on it. Rather virtual threads get created by default and an explicit call, or thread factory can be used to get the value back. At least that is how I remember it.
- jayd16 5y agoYeah, so if you have to explicitly call the new API when you need to use it form an OS thread, its not very implicit. That's what makes me curious about how they'll smooth that out.
- kaba0 5y agoIf you already have an executorservice, calling createVirtualThread is all you need to use Loom afaik.