Re: Proper parallelism?

2011-11-22 Thread Linus Ericsson
There's an approach using agents described here:

http://travis-whitton.blogspot.com/2009/07/network-sweeping-with-clojure.html

It's a bit old, so somethings in the example could be a bit outdated, but
the idea may help you forward,

/Linus

2011/11/22 AndyK 

> I have been using Clojure to write tests on RESTful applications.
> Since the requests are independent, parallelizing would speed things
> along. What is the best approach? Using pmap is the obvious first
> step. Afaik, pmap only creates a small pool of threads. Is there more
> to gain by going to the Java API's threading classes (like
> ExecutorService, or building a pool of threads triggered by a
> CountDownLatch)? What experience have folks had with different
> approaches?
>
> thx
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Proper parallelism?

2011-11-22 Thread vitalyper
Andy,

You can also look into using futures (pmap uses future).
In section 11.6.1 of "Joy of Clojure" there is a recipe how to
dispatch multiple RPC calls in parallel using as-futures macro.
Obviously, this depends on what you want to do with results of your
REST calls.

On Nov 22, 11:16 am, AndyK  wrote:
> I have been using Clojure to write tests on RESTful applications.
> Since the requests are independent, parallelizing would speed things
> along. What is the best approach? Using pmap is the obvious first
> step. Afaik, pmap only creates a small pool of threads. Is there more
> to gain by going to the Java API's threading classes (like
> ExecutorService, or building a pool of threads triggered by a
> CountDownLatch)? What experience have folks had with different
> approaches?
>
> thx

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Proper parallelism?

2011-11-22 Thread Gary Trakhman
Clojure futures use the send-off thread-pool (unbounded), which is defined 
like this:

from Agent.java:
final public static ExecutorService soloExecutor = 
Executors.newCachedThreadPool(createThreadFactory("clojure-agent-send-off-pool-%d",
 
sendOffThreadPoolCounter));

So, it's using executors.  If you want more control, you can maybe look at 
JMeter's implementation for guidance, or use its API directly for test 
plans.  Not sure what the simplest route is for your needs.  

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en