TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Features of Project Loom incorporated in JDK 21

222 点作者 philonoist超过 1 年前

12 条评论

avodonosov超过 1 年前
Congrats to Ron Pressler (pron at HN) and the team. Who worked on it for so long, ever since the Quasar library.
tomaytotomato超过 1 年前
Nice, Project Loom is often summarised as just incorporating the main feature of Virtual Threads however it will also add a whole bunch of other features or improvements for doing tasks concurrently and not having to worry about blocking IO or race conditions like you would have in the past.<p>Some useful code examples are here to play around with <a href="https:&#x2F;&#x2F;github.com&#x2F;nipafx&#x2F;loom-lab">https:&#x2F;&#x2F;github.com&#x2F;nipafx&#x2F;loom-lab</a>
评论 #37136074 未加载
kitd超过 1 年前
There are some fairly major Java backend libraries that are founded almost entirely on async-type APIs. Eg, Vertx, Quarkus, Micronaut, etc.<p>I am interested to see how a widespread move to virtual threads, which for them is somewhat existential, affects their futures (pun intended). Also what backend libs that are founded on virtual threads emerge and supplant them.
评论 #37132692 未加载
评论 #37133269 未加载
评论 #37134516 未加载
评论 #37134130 未加载
评论 #37136853 未加载
评论 #37133876 未加载
dveeden2超过 1 年前
Info on what Project Loom is: <a href="https:&#x2F;&#x2F;cr.openjdk.org&#x2F;~rpressler&#x2F;loom&#x2F;Loom-Proposal.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;cr.openjdk.org&#x2F;~rpressler&#x2F;loom&#x2F;Loom-Proposal.html</a>
评论 #37132463 未加载
评论 #37134712 未加载
misja111超过 1 年前
Does anybody know what this will mean for the already existing green threads implementations in e.g. Kotlin and Scala Cats? Will these benefit from project Loom, or are they somehow incompatible?
评论 #37131550 未加载
评论 #37131535 未加载
评论 #37131896 未加载
评论 #37131793 未加载
评论 #37137801 未加载
评论 #37131506 未加载
评论 #37132323 未加载
评论 #37131487 未加载
MichaelMoser123超过 1 年前
Other than cooperative threading: they are also adding a more versatile switch statement, with some form of pattern matching <a href="https:&#x2F;&#x2F;openjdk.org&#x2F;jeps&#x2F;441" rel="nofollow noreferrer">https:&#x2F;&#x2F;openjdk.org&#x2F;jeps&#x2F;441</a><p>But it still falls short of deconstruction patterns of Scala, though that is something that they want to do in the future (see &#x27;Future Work&#x27; section)<p>i think that Scala is driving a lot of progress: (for example java adopted streams, probably inspired by Scala)
tomohawk超过 1 年前
It&#x27;s great to see this, but it&#x27;s not going to make me want to go back to Java from Go. In Go, everything is built with this sort of concurrency from the ground up. This makes everything fit together very nicely without the cognitive overhead and dissonance you have to work through with the Java libraries of various vintages and approaches.
评论 #37137579 未加载
评论 #37137356 未加载
deutschepost超过 1 年前
At first I misread and wondered what Project Loon[1] could possibly contribute to JDK 21.<p>[1]<a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Loon_LLC" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Loon_LLC</a>
评论 #37132106 未加载
senda超过 1 年前
any metrics to compare this to say streams or any other OS based parallelisation?
nvm0n2超过 1 年前
A good step forward and nice that it&#x27;s in the next (Oracle) LTS version. But is it too late? NodeJS started cleaning up by pushing async-for-all over a decade ago. Then Go came along and did the same thing but with a simple statically typed language. The Java world developed async server frameworks + GraalVM native image in response and now will be able to incrementally phase them out, but Java lost significant ground server-side because it took so long to identify and respond to these moves by competitors.<p>The question is now whether Java will regain some of that lost ground, or whether people came for the async but stay for the &quot;isomorphism&quot; (same language in both browser and server) &#x2F; AOT compilation model.<p>My gut says it&#x27;s not too late for them and devs do engage in a kind of continuous rolling evaluation of platforms. Once Java 21 launches people might start to re-evaluate Java vs Node and once Loom is fully supported in native images, you might start to see people re-evaluate Java vs Go at least. Where by &quot;Java vs&quot; I really mean &quot;JVM languages vs&quot; like with Kotlin, Scala and Clojure as well. Or maybe even Loom will be compatible with GraalJS and then you can do fully blocking programming with Node-style efficiency but on the JVM.
评论 #37131725 未加载
评论 #37131916 未加载
评论 #37131655 未加载
评论 #37132212 未加载
评论 #37131726 未加载
评论 #37131587 未加载
评论 #37131834 未加载
评论 #37131736 未加载
zackees超过 1 年前
Aka green threads.
评论 #37131868 未加载
spullara超过 1 年前
Basically you ignore a bunch of the work done for async, callbaks, etc and go back to making a new &quot;thread&quot; and handling a request.
评论 #37132005 未加载
评论 #37131861 未加载
评论 #37131576 未加载
评论 #37136999 未加载