> Doesn't pmap have to construct the whole sequence explicitly in order
> to map its execution across more than one processor?  or does it take
> in a lazy fashion?

Semi-lazy, according to the doc:

 Like map, except f is applied in parallel. Semi-lazy in that the
  parallel computation stays ahead of the consumption, but doesn't
  realize the entire result unless required.

But I don't think lazyness is the problem:

user=> (def r (doall (map inc (range 1000000))))
#'user/r
user=> (count r)
1000000
user=> (pmap inc [0])
java.lang.OutOfMemoryError: Java heap space (NO_SOURCE_FILE:0)

That is, map's fine with fully realizing a sequence of a million
items; & pmap consumes all of the heap with a sequence of one item.

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