7 ms·
> Virtual threads offer a more efficient alternative to platform threads, allowing developers to handle a large number of tasks with significantly lower overhea
by kjto 3y ago
> Virtual threads offer a more efficient alternative to platform threads, allowing developers to handle a large number of tasks with significantly lower overhead.
they should have just called them "Tasks" leaving the already overloaded term "virtual" out of the conversation.
- marginalia_nu 3y agoJava's already got tasks[1] within the namespace of parallelism though, but it hasn't overloaded any meaning onto virtual. [1] https://docs.oracle.com/javase/9/docs/api/index.html?javafx/concurrent/Task.html https://docs.oracle.com/javase/9/docs/api/index.html?javafx/...
- vips7L 3y agoJavaFX is not really a part of Java and isn’t actually shipped with most builds of OpenJdk. Azul Zulu is the only build that I know of that you can get FX built in.
- BenoitP 3y agoIMHO virtual is the perfect word. The JVM's entire schtick is abstracting (virtual) hardware (machine). A simple API pertaining to intent, that can be materialized depending on OS and hardware. Calls are virtual, though under the hood the compiler may inline them. Memory is managed, though through analysis some allocations will go on the stack. Threads are now (no full grandfathering, but they tried) virtual, and the runtime may now optimize them differently on different OSes and hardware.
- aardvark179 3y agoWe went through a lot of iterations on what they should be called. They were originally called Fibers, but since they were extremely thread like it was decided they should be actual threads, so they should be some type of thread. Once that decision was made the question then becomes which adjective to add to Thread, and things like LightWeight, Small, etc. were ruled out as smaller or more lightweight threads might be introduced in the future.
- mattgreenrocks 3y agoThanks for the explanation. That makes a lot of sense. Naming things well is harder than making said things sometimes.
- giantrobot 3y agoNaming things is one of the two hard problems in computer science along with cache invalidation and off-by-one errors.
- layer8 3y agoThey are of type `Thread`, for interoperability with existing code.