Re: Are agents suitable for c10k concurrency?

2012-11-18 Thread Stuart Sierra
What matters is the I/O framework. You'll want to use a non-blocking network library, then you should be able to use `send` rather than `send-off`. `send` uses a fixed-size thread pool for all Agents in the system. That said, while I believe Agents are a suitable solution to this problem,

Are agents suitable for c10k concurrency?

2012-11-17 Thread Elliot
Hi all, I'm writing a c10k-style service, i.e. suppose 10,000 concurrent connections, mostly IO-bound. Clojure agents with `send-off` are fantastically close to what I want conceptually, but I'm curious about the implementation details--can anyone confirm, this would end up forking 10,000

Re: Are agents suitable for c10k concurrency?

2012-11-17 Thread Philip Potter
send-off works by submitting a Runnable to a newCachedThreadPool. http://stackoverflow.com/questions/11316737/managing-agent-thread-pools-in-clojure A Runnable sent to a thread pool will have exclusive use of that thread until it completes; therefore, greater concurrency can only be achieved by

Re: Are agents suitable for c10k concurrency?

2012-11-17 Thread László Török
Hi I would only add, that with Clojure 1.5 you can supply your own Executor using (send-via ), the default threadpools are not hard-wired anymore. See https://github.com/clojure/clojure/commit/f5f4faf95051f794c9bfa0315e4457b600c84cef#src/jvm/clojure/lang/Agent.javafor further details. Las On