Home Internationalcore.async and Virtual Threads...
InternationalтнР Featured

core.async and Virtual Threads

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 io-thread was added in a previous core.async release and is a new execution context for running both blocking channel operations and blocking I/O operations (which are not supported in go ). Parking operations are not allowed in io-thread (same as the thread context). io-thread uses the :io executor pool, which will now use virtual threads, when available. If used in Java without virtual threads (< 21), io-thread continues to run in a cached thread pool with platform threads. With this change, all blocking operations in io-thread park without consuming a platform thread on Java 21+. go blocks Clojure core.async go blocks use an analyzer to rewrite code with inversion of control specifically for channel parking operations (the ! async ops like >! ). Other blocking operations ( !! channel ops or arbitrary I/O ops) are not allowed. Additionally, go blocks are automatically collected if the channels they depend on are collected (and parking can never progress). The Java 21 virtual threads feature implements I/O parking in the Java platform itself - that capability is a superset of what go blocks provide by

6 April 2026 at 05:53 pm
1 views
core.async and Virtual Threads

core.async 1.9.847-alpha3 has been released, marking a significant update in the virtual thread implementation. This version reverts the changes introduced in alpha2 and introduces a new implementation based on ASYNC-272. The core innovation lies in the ability to handle blocking I/O operations more efficiently, allowing users to write straightforward, linear code without the need for callbacks while reducing platform resource consumption.

In this release, the io-thread execution context has been enhanced. Introduced in a previous core.async release, io-thread is designed to execute both blocking channel operations and I/O operations that are not supported in the go blocks. Importantly, parking operations are not permitted in io-thread, adhering to the same constraints as the thread context. The io-thread execution context now utilizes the :io executor pool, which will leverage virtual threads when available.

For Java environments without virtual threads (pre-Java 21), io-thread continues to operate within a cached thread pool, utilizing platform threads. With the introduction of virtual threads in Java 21 and later, all blocking operations within io-thread will park without consuming a platform thread. This optimization ensures that applications can handle I/O-bound tasks more efficiently, reducing the overhead associated with maintaining a large number of threads.

The go blocks in Clojure core.async have also been updated to integrate with this new virtual thread implementation. Go blocks use an analyzer to rewrite code with inversion of control specifically for channel parking operations, such as the ! async ops like >!. However, other blocking operations, such as !! channel ops or arbitrary I/O operations, are not supported within go blocks. Additionally, go blocks are automatically collected if the channels they depend on are collected, ensuring that parking can never progress in such cases.

Java 21's virtual threads feature introduces I/O parking capabilities natively within the Java platform, which is a superset of the functionality provided by go blocks. While virtual threads support all blocking I/O operations, they differ from go blocks in that they must terminate ordinarily and will keep referenced resources alive until they do. This distinction in semantics means that go blocks remain unchanged and continue to use the go analyzer and run on platform threads.

If developers wish to leverage the benefits and constraints of virtual threads, they can convert go blocks to io-thread execution context. This change allows them to take advantage of the improved efficiency and resource management offered by virtual threads while adhering to the specific constraints of the io-thread context.

In summary, core.async 1.9.847-alpha3 introduces a new virtual thread implementation that enhances the handling of blocking I/O operations, enabling developers to write more efficient and linear code. The io-thread execution context has been refined to better utilize virtual threads, and go blocks have been updated to integrate with this new approach. This release represents a significant step forward in optimizing I/O-bound applications and demonstrates the potential of virtual threads in Java 21 and later versions.

Source: Clojure News
ЁЯУ░ Related News
Ollama 0.2.6 Released with Native Gemma 4 Support and Enhanced Performance
Ollama 0.2.6 Released with Native Gemma 4 Support and Enhanced Performance
Ollama 0.2.6 is now live, featuring native support for Google's Gemma 4 models and improved local inference performance for Windows, macOS, and Linux.
14 Apr
Weekly news roundup: Shortages spread to MLCCs; SK Hynix reportedly in talks with Microsoft and Google
Weekly news roundup: Shortages spread to MLCCs; SK Hynix reportedly in talks with Microsoft and Google
Below are the most-read DIGITIMES Asia stories from the week of April 6-April 13, 2026:
14 Apr
cutile-stencil 0.2.0
cutile-stencil 0.2.0
An xDSL-based stencil compiler that generates optimized GPU kernels via NVIDIA cuTile
14 Apr
merlin-llm added to PyPI
merlin-llm added to PyPI
Merlin тАФ a fast local LLM for agentic coding on Apple Silicon
14 Apr
Fluent Cut - Craft and compose videos programmatically in PHP with an elegant fluent API
Fluent Cut - Craft and compose videos programmatically in PHP with an elegant fluent API
Craft and compose videos programmatically in PHP with an elegant fluent API - b7s/fluentcut
14 Apr
Crypto Investor at Center of Trump Corruption Allegations Now Sees Himself as тАШVictimтАЩ
Crypto Investor at Center of Trump Corruption Allegations Now Sees Himself as тАШVictimтАЩ
Justin Sun has accused Trump-affiliated World Liberty Financial of misconduct and a general lack of transparency.
14 Apr
nvidia-nat-weave 1.7.0a20260413
nvidia-nat-weave 1.7.0a20260413
Subpackage for Weave integration in NeMo Agent Toolkit
14 Apr
nvidia-nat-s3 1.7.0a20260413
nvidia-nat-s3 1.7.0a20260413
Subpackage for S3-compatible integration in NeMo Agent Toolkit
14 Apr
Social Security Trust Fund to Run Dry in 2032: Just 6 Years From Now
Social Security Trust Fund to Run Dry in 2032: Just 6 Years From Now
Six years. That is how much time separates retirees from a Social Security system that, by its own projections, runs out of money. If you are 56 years old...
14 Apr
cane-gpu-perf added to PyPI
cane-gpu-perf added to PyPI
GPU inference benchmarking with opinionated diagnostics
13 Apr