Hi,

'takeMVar' documentation says "if there are
multiple threads blocked in takeMVar, and the
MVar becomes full, only one thread will be
woken up."

Since 'takeMVar' is a reading function, i.e.,
it doesn't change the value of the
"variable", why waking up only one thread? If
we wake multiple threads, there's no risk of
one changing the value while the other is
reading.

Does that mean that all threads waiting for
that MVar will get the same value, even if
one of those threads change it's value just
after reading?

Thanks,
Maurício

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to