> does access to
> lets say second part of partitioned range cause first part to be
> materialized or no?

Yes, it does.

> My second question is connected to first. If we have 4 cores and *pmap *starts
> 4 threads to perform our function on 4 parts of partitioned range, is this
> happening in parallel, or it is not (because of partitioned ranges
> dependence or something else)?

It's all lazy processing, so you'll get one initial thread (I believe
because of a destructuring in pmap). The rest of the threads will
start as apply gets elements from "result", which may or may not be in
parallel depending on scheduling and how much work needs to be done,
in this case it isn't much. (partition) will produce four ranges in
order, as (future) calls on each are setup by pmap, That is, pmap
launches threads sequentially, each already having a range from the
partition.

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