OTOH, certainly doing an IO operation should cause a thread switch.
In my limited use of the concurrency extension, I found it hard to
write a dining philosophers program that behaved randomly.  I had to
throw yield's in all over the place.  The `GHC-specific concurrency
issues' of the hslibs documentation should have more discussion about
when GHC pre-empts threads and how to control it.

I could have a go myself,  but I'm sure someone else with more
experience could do a much better job. 


k

George Russell writes:
 > Simon Marlow wrote:
 > > The patch below causes a reschedule after a putMVar has woken a thread.  It
 > > helps the program above, and maybe it's the right thing to do in general -
 > > opinions?
 > If it makes such putMVars much more expensive I'm against it.
 > 

Reply via email to