News Score: Score the News, Sort the News, Rewrite the Headlines

Clojure: managing throughput with virtual threads

06 May 2024Before the introduction of Java 21 virtual threads we were heavy users of claypoole a fantastic library for simple but effective parallelism using thread pools. However, things get complicated with virtual threads, they shouldn't be pooled, as they aren't a scarce resource. So how do we limit throughput when we have "unlimited" threads? In this post we will look at using java Semaphore class to implement basic token bucket rate limiting to control throughput.One of the other key insig...

Read more at andersmurphy.com

© News Score  score the news, sort the news, rewrite the headlines