I agree that the burn-with-futures code looks not right:
(defn burn-via-futures [n]
 (print n " burns via futures: ")
 (time (doall (pmap deref (map (fn [_] (future (burn)))
                                                 (range n))))))

should probably be something like:

(defn burn-via-futures [n]
 (print n " burns via futures: ")
 (time (dorun (map deref (dorun (map (fn [_] (future (burn)))
                                                 (range n))))))

Otherwise, your pmap is throttling the creation and execution of the
futures.  (It may be that the throttling behavior of the pmap is irrelevant
or possibly even helpful in this particular code, but it seems like you
really want to test how the system handles 48 futures that are created all
at once).

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