Okay, that is a blatant infinite loop that has nothing to do with
deadlocks. I give up. This combination of laziness and concurrency and
locking is giving me a headache. Sorry about the distraction,
everyone.

-Per

On Mon, Apr 26, 2010 at 6:23 PM, Per Vognsen <[email protected]> wrote:
> On Mon, Apr 26, 2010 at 6:15 PM, Per Vognsen <[email protected]> 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 [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

Reply via email to