
28 Mar
2006
28 Mar
'06
1:02 p.m.
On Tue, 2006-03-28 at 11:05 +0100, Malcolm Wallace wrote: (snip)
* IORef is inherently thread-unsafe, and so we should eliminate IORefs from the language.
That's not quite true, as you can have an IORef guarded by an MVar. Why would you want such a thing? For instance, you might write a library with two IORefs and one MVar instead of two MVars in order to reduce the possibility of deadlock. Is it the case that a library is thread-safe as long as it doesn't use IORefs, though? I trolled around base looking for libraries that might not be thread-safe and found only that HashTable uses an IORef, and indeed there's a FIXME that says it should use an MVar. I didn't look very hard, though. peace, isaac