Clojure lots of threads

Posted by Timothy Baldridge on Stack Overflow See other posts from Stack Overflow or by Timothy Baldridge
Published on 2010-06-14T19:14:17Z Indexed on 2010/06/14 19:52 UTC
Read the original article Hit count: 330

Filed under:

I just got done watching Rick Hickey's "Clojure Concurrency" talk, and I have a few questions about threads.

Let's say I have a situation with lots of Agents, let's say 10,000 of them running one machine. I'd rather not have 10,000 CPU threads running at once, but I don't want threads to be blocked by the actions of other threads.

In this example I won't really be waiting for replies, instead each Agent will be sending a message or two, and then waiting until it gets a message.

How would I structure a program like this without getting 10k OS threads which would probably end up slowing the system down.

© Stack Overflow or respective owner

Related posts about clojure