Proposal: Stop enforcing single-writer-multi-reader file access

Edward Z. Yang ezyang at MIT.EDU
Thu Oct 27 17:23:20 CEST 2011


But I kind of wonder if there don't exists programs that will break
due to this. Probably only those that people have actually put in
some attention to cross-platform compatibility.


Excerpts from Ian Lynagh's message of Wed Oct 26 18:59:38 -0400 2011:
> Hi all,
> Haskell currently requires that multiple-reader single-writer locking is
> used on files. I understand the motivation for this was to try to
> protect people from running into problems due to lazy IO, but in
> practice I think it just causes more problems than it solves.
> The decision may also have been influenced by the belief that this
> behaviour is enforced for all programs on Windows, but I am told that it
> is possible to get lock-free behaviour on Windows too.
> I propose that we remove all the automatic locking from the libraries,
> and let the user do any locking that they wish to do themselves.
> Attached are patches for ghc, base, process and unix. (not yet tested on
> Windows).
> Suggested discussion period: Until 9 Nov 2011
> Related GHC ticket:
> Thanks
> Ian

More information about the Libraries mailing list