Tom Pledger writes: > [...] > > Something along these lines: But without the bug and the eccentricities. :-( > [...] > wasDown2 <- sag flag2 This just moved the deadlock. Instead of doing a busy wait for a non-sagging flag2, we must put flag1 back up and try again from the beginning of lowerFlags. > _ <- takeMVar flag1 -- We know flag1 is now sagging Or: takeMVar flag1 > if wasDown2 then putMVar flag1 Up else do > _ <- takeMVar flag2 -- We know flag2 is now sagging > putMVar flag2 Down Or: if ... swapMVar flag2 Down Regards, Tom
- Trivial Haskell Concurrency problem George Russell
- Re: Trivial Haskell Concurrency problem Michael Hobbs
- Trivial Haskell Concurrency problem Tom Pledger
- Re: Trivial Haskell Concurrency problem Tom Pledger
- Re: Trivial Haskell Concurrency problem Michael Hobbs
- Re: Trivial Haskell Concurrency problem Michael Hobbs
- Re: Trivial Haskell Concurrency problem Michael Hobbs
- Re: Trivial Haskell Concurrency pro... George Russell
- RE: Trivial Haskell Concurrency problem Simon Peyton-Jones
- Re: Trivial Haskell Concurrency problem George Russell
- Re: Trivial Haskell Concurrency problem Wolfram Kahl
- Re: Trivial Haskell Concurrency problem Marcin 'Qrczak' Kowalczyk
- Re: Trivial Haskell Concurrency problem George Russell
- RE: Trivial Haskell Concurrency problem Simon Peyton-Jones