On Mon, Apr 26, 2010 at 6:15 PM, Per Vognsen <per.vogn...@gmail.com> wrote:
>
[...]
> The idea is to try to create a situation where a pair of LazySeqs, xs
> and ys, are interlinked in a cycle such that the first thread forces
> them in order xs, ys while the second thread concurrently forces them
> in order ys, xs. This could happen if thread #1 evaluates (doall (take
> 3 xs)) and thread #2 evaluates (doall (take 3 ys)).

Actually, it occurs to me that they wouldn't have to be physically
interlinked at all. It's enough for their thunks to be mutually
referential:

(def xs (lazy-seq (first ys) nil))
(def ys (lazy-seq (first xs) nil))

-Per

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