
29 Nov
2007
29 Nov
'07
1:52 a.m.
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