First off, the code you posted can't actually be right: you have
(println n) but the for binding was for i.

Second, given your macro, try (range 100) instead of (range 10) and
see what you get...

On Wed, May 23, 2012 at 10:56 PM, Cedric Greevey <cgree...@gmail.com> wrote:
> For some reason, this doesn't actually seem to be executing in parallel:
>
> (defmacro pdoseq
>  "Bindings as for for, but parallel execution as per pmap, pcalls,
> pvalues; returns
>   nil."
>  [seq-exprs & body]
>  `(do
>     (doall
>       (pmap identity
>             (for ~seq-exprs (do ~@body)))
>     nil)))
>
> user=> (pdoseq [i (range 10)] (println n))
> 0
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
>
> Never any interleaving of output and if I give it a big CPU-bound job
> to do for each integer it only saturates one core.
>
> I thought it might be a chunked-seq issue, but:
>
> user=> (chunked-seq? (range 10))
> false

-- 
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

Reply via email to