Yep, thanks, my bad. I got the point.

Actually, what I was trying to do, is to prototype multithreaded i/o 
operation via reducers. And then use fold to regulate number of concurrent 
operations.
But now something tells me I am doing not very clever thing.

On Friday, April 26, 2013 5:27:46 PM UTC+3, Stanislav Yurin wrote:
>
> I was assuming that following code will fold in parallel, but it is 
> reduced sequentially
>
> (require '[clojure.core.reducers :as r])
> (defn test1 
> [x] 
> (Thread/sleep 1000) 
> (println (str "Finished:" x))
> x)
> (def xxx (r/map test1 (range 100)))
> (r/fold + xxx)
>
> What am I doing wrong?
> Thanks.
>

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to