[Haskell-cafe] Re: Concurrency questions

2008-01-07 Thread apfelmus
Andrew Coppin wrote: 2. You have to take the data out of an MVar to read it. In other words, only 1 thread can read an MVar at once [by design]. This isn't truly a problem in the current case, but it's irritating in principle that I can't make it so that once the cell is written, multiple

[Haskell-cafe] Re: Concurrency questions

2008-01-07 Thread Ben Franksen
Spencer Janssen wrote: On Sun, Jan 06, 2008 at 11:30:53AM +, Andrew Coppin wrote: 1. Is there some way to assign a priority to Haskell threads? (The behaviour I'd like is that high priority threads always run first, and low priority threads potentially never run at all unless there's an

[Haskell-cafe] Re: Concurrency questions

2008-01-07 Thread Achim Schneider
Ben Franksen [EMAIL PROTECTED] wrote: Spencer Janssen wrote: On Sun, Jan 06, 2008 at 11:30:53AM +, Andrew Coppin wrote: 1. Is there some way to assign a priority to Haskell threads? (The behaviour I'd like is that high priority threads always run first, and low priority threads

[Haskell-cafe] Re: Concurrency questions

2008-01-06 Thread Achim Schneider
Andrew Coppin [EMAIL PROTECTED] wrote: 2. I have a situation where I have a thread generating some data and putting it into a mutable array, and another thread trying to read that data. Is there a way I can make the reader thread block if it tries to read a cell that hasn't been computed

[Haskell-cafe] Re: Concurrency questions

2008-01-06 Thread Ben Franksen
Andrew Coppin wrote: Felipe Lessa wrote: On Jan 6, 2008 9:30 AM, Andrew Coppin [EMAIL PROTECTED] wrote: 2. I have a situation where I have a thread generating some data and putting it into a mutable array, and another thread trying to read that data. Is there a way I can make the reader