Hi, On 26 Apr., 11:22, Per Vognsen <[email protected]> wrote:
> Consider: > > (def as (lazy-seq (cons 1 bs))) > (def bs (lazy-seq (cons 2 cs))) > ;; ... > (def zs (lazy-seq (cons 26 as))) > > Suppose you start two threads concurrently. The first forces 'as' and > the second forces 'zs'. If the timing is just right, this can result > in a deadlock: How? As far as I understand the code forcing as and zs are basically independent tasks. seq does not recursively call into the rest. And then you'd even need a circular structure (which is - I believe - what you indicate with your "fill the next number" dots). Even a fixed version of forcing wouldn't return anyway on such a structure, no? But maybe I just don't understand what you mean with "forcing". Sincerely Meikel -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
