TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Clojure: Managing throughput with virtual threads

165 pointsby refsetabout 1 year ago

5 comments

koito17about 1 year ago
Pretty cool use case for virtual threads. Recently I implemented something with core.async in order to batch messages and dispatch them to some UI code at a fixed rate. It was definitely a lot more complicated than using a single sempahore like shown in this article.<p>On a related note, it would be nice to have an implementation of CSP using proper virtual threads rather than the thread pool currently used by core.async. The promesa library currently has a proof-of-concept[1], but it doesn&#x27;t seem interoperable with existing core.async code.<p>[1] <a href="https:&#x2F;&#x2F;funcool.github.io&#x2F;promesa&#x2F;latest&#x2F;promesa.exec.csp.html" rel="nofollow">https:&#x2F;&#x2F;funcool.github.io&#x2F;promesa&#x2F;latest&#x2F;promesa.exec.csp.ht...</a>
评论 #40283458 未加载
harperleeabout 1 year ago
One related article that I found interesting: <a href="https:&#x2F;&#x2F;ericnormand.me&#x2F;guide&#x2F;clojure-virtual-threads" rel="nofollow">https:&#x2F;&#x2F;ericnormand.me&#x2F;guide&#x2F;clojure-virtual-threads</a>
评论 #40283472 未加载
fishyjoeabout 1 year ago
Good to know that refs and atoms are not safe to use in virtual threads. I would have definitely found that out the hard way since atoms are so simple to use.
packetlostabout 1 year ago
I wonder if core.async will be updated to work well with virtual threads? Anyone more involved in Clojure know if it will?
评论 #40281279 未加载
评论 #40282844 未加载
amgregabout 1 year ago
&gt; things get complicated with virtual threads, they shouldn&#x27;t be pooled, as they aren&#x27;t a scarce resource<p>Why not pool virtual threads, though? I get that they’re not scarce, but if you’re looking to limit throughput anyway wouldn’t that be easier to achieve using a thread pool than semaphores?
评论 #40283416 未加载
评论 #40283696 未加载