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