Re: Laziness and deadlocks

2010-04-26 Thread Meikel Brandmeyer
Hi, On 26 Apr., 13:27, Per Vognsen wrote: > 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. Well, we can step through the code a

Re: Laziness and deadlocks

2010-04-26 Thread Per Vognsen
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 wrote: > On Mon, Apr 26, 2010 at 6:15

Re: Laziness and deadlocks

2010-04-26 Thread Per Vognsen
On Mon, Apr 26, 2010 at 6:15 PM, Per Vognsen 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

Re: Laziness and deadlocks

2010-04-26 Thread Per Vognsen
On Mon, Apr 26, 2010 at 5:55 PM, Meikel Brandmeyer wrote: > Hi, > > On 26 Apr., 11:22, Per Vognsen 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 fir

Re: Laziness and deadlocks

2010-04-26 Thread Meikel Brandmeyer
Hi, On 26 Apr., 11:22, Per Vognsen 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,

Laziness and deadlocks

2010-04-26 Thread Per Vognsen
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: // LazySeq.java final synch