Welcome! Please see the About page for a little more info on how this works.

+5 votes
in core.async by

There have been a few people on Slack asking about virtual threads and core.async before. Here is an example of one such thread https://clojurians.slack.com/archives/C05423W6H/p1677676131782299

Of course, consideration is also needed for ClojureScript and non-Loom code. I would assume a virtual thread aware implementation of core.async would probably exist in a dedicated namespace to prevent breaking old code.

I am posting this question both as a feature request and a central place for people to vote.

2 Answers

+3 votes
by

Virtual threads are likely to have us rethink a lot of things about core.async and we've already been talking about it. After Clojure 1.12 is out I think it's likely to be high on our list. Very TBD what this will mean from a release perspective (considering the Java 21 requirement).

0 votes
by

Spindle monkey patches core.async to add this capability. Note: I’m not the author of this library, nor (yet) a user of it, though I greatly respect the author’s contributions to the Clojure ecosystem.

by
Note that core.async still uses a real O/S thread for dispatch even with patching the main pool to use vthreads.

And today we'd expect to use core.async more for CPU-bound tasks and not for I/O-bound tasks, whereas vthreads are optimized toward I/O-bound tasks -- so there's an inherent tension in simply patching core.async to use vthreads.
...