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

Ian Lynagh igloo at earth.li
Thu Oct 27 00:59:38 CEST 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: http://hackage.haskell.org/trac/ghc/ticket/4363


Thanks
Ian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Stop-enforcing-single-writer-multi-reader-file-acces.patch
Type: text/x-diff
Size: 7030 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/libraries/attachments/20111026/53ee2aec/attachment-0004.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Stop-enforcing-single-writer-multi-reader-file-acces.patch
Type: text/x-diff
Size: 8780 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/libraries/attachments/20111026/53ee2aec/attachment-0005.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Stop-enforcing-single-writer-multi-reader-file-acces.patch
Type: text/x-diff
Size: 995 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/libraries/attachments/20111026/53ee2aec/attachment-0006.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Stop-enforcing-single-writer-multi-reader-file-acces.patch
Type: text/x-diff
Size: 764 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/libraries/attachments/20111026/53ee2aec/attachment-0007.patch>


More information about the Libraries mailing list