首页›Clojure News›文章

core.async and Virtual Threads

2026年3月11日

AI 摘要 AI 生成,可能有误

core.async 1.9.847-alpha3 回退了 alpha2 中的虚拟线程实现,并引入了一个新的实现:在 Java 21 及以上版本上,io-thread 执行上下文使用虚拟线程,从而允许阻塞式通道操作和 I/O 操作在不占用平台线程的情况下挂起。go 块保持不变,继续在平台线程上使用 go 分析器,因此希望获得虚拟线程语义的用户应将 go 转换为 io-thread,并将挂起操作转换为阻塞操作。此外,executor-factory 系统属性现在只要求 Executor 实例而非 ExecutorService 实例,这是一项向后兼容的要求放宽。

core.async 1.9.847-alpha3 is now available. This release reverts the core.async virtual thread implementation added in alpha2, and provides a new implementation (ASYNC-272).

Threads must block while waiting on I/O operations to complete. "Parking" allows the platform to unmount and free the underlying thread resource while waiting. This allows users to write "normal" straight line code (without callbacks) while consuming fewer platform resources.

io-thread execution context

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Clojure News

Clojure 1.12.8

AI 摘要Clojure 1.12.8 is now available, replacing the 1.12.7 change related to a serialization vulnerability (GHSA-x4c4-68gp-vrhc) where Clojure function classes could be exploited when reading serialized Java data from untrusted streams. Function serialization is now always allowed, while deserialization is controlled by the new system property clojure.deserialize.code and the dynamic var *deserialize-code*, which can allow it, block it with an IOException, or throw a RuntimeException when set to :unknown to alert developers of unprotected code paths.

Clojure 1.12.7

AI 摘要Clojure 1.12.7 has been released, addressing a security vulnerability (GHSA-x4c4-68gp-vrhc) where Clojure function classes could be exploited alongside standard JDK classes to execute arbitrary code during deserialization of untrusted serialized Java data. As of this version, Clojure functions throw exceptions on serialization and deserialization by default, with the system property -Dclojure.serializable.fns=true available to explicitly allow these operations in known-safe contexts.

State of Clojure 2026 Survey

AI 摘要The annual State of Clojure 2026 Survey is now open, inviting users of Clojure, ClojureScript, or other Clojure dialects to participate. Running since 2010, the survey is the main barometer of the Clojure community's views and daily practices, takes only a few minutes, and closes on November 30, with results to be released toward the end of the year.

Clojure 1.13.0-alpha11

AI 摘要Clojure 1.13.0-alpha11 has been released, with download and usage information available on the Downloads page. This version fixes CLJ-2990, a bug where :req! on a nested map with :missing binds an internal Object. Users can try it by adding the version to their deps.edn or starting a REPL with the Clojure CLI.

Clojure 1.13.0-alpha10

AI 摘要Clojure 1.13.0-alpha10 has been released, featuring destructuring changes such as a new :req! directive to make top-level bindings required and :namespaced/keys directives that now qualify unqualified keywords (a potentially breaking change). The release also includes inliner updates enabling conditional inlining that can return nil, inlining of get-in with literal key vectors, and preservation of type hint metadata on macro invocations. Users can try it by updating their deps.edn dependencies or starting a REPL with the Clojure CLI.