Skip to content

Comment on Clojure's concurrent agents in action

Comments

send should never be used in a function that will not keep the CPU busy, such as one that calls Thread/sleep. send-off, which will allocate a new thread rather than taking up a slot in Clojure's fixed-size agent thread pool, should be used instead.

It's fine if you're just using it to simulate a computationally expensive operation, as he is here. In fact, in that case, it's slightly more realistic.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.