3 ms·
Do you know if clojure will be adopting these virtual threads, or still using the macro-based approach?
by logicchains 3y ago
Do you know if clojure will be adopting these virtual threads, or still using the macro-based approach?
- deleted 3y ago[deleted]
- bcrosby95 3y agoIt depends upon what you mean here. You could always set the backing thread pools for core.async and agents in Clojure. That gives you the ability to use virtual threads right now. But in order to avoid thread pinning, there will need to be some code changes to convert some uses of synchronized to ReentrantLock. How fast that happens will depend upon the given library maintainer. Here's an issue for making some of these changes in Clojure's core library: https://clojure.atlassian.net/browse/CLJ-2771 https://clojure.atlassian.net/browse/CLJ-2771 I've tested Clojure's agents with the new virtual threads for my targeted use case they're significantly faster than before - I can spin up tens of thousands of mostly idle agents and reach performance close enough to core.async for me.