Descriptionos: Remove file lock on Windows
This lock has been introduced as a fix to emulate Linux' Pread semantic on Windows (see http://codereview.appspot.com/4415041/).
On Linux Pread and Pwrite do not change the current file position but on Windows do.
To emulate Linux semantic, Pread on Windows was implemented as the sequence of Lock, GetFilePos, Read, Seek, Unlock.
This patch solves the problem in a lightweight way, storing a fake file pointer inside File structure.
ReadAt() and WriteAt() can be called from different threads in parallel.
Also, with this patch, all the file reads and writes became overlapped, making it easy to wait for their completion in a non-blocking way (as it is done with sockets).
The same IOCP loop can be shared for sockets and files.
Patch Set 1 #Patch Set 2 : diff -r c0852f6d0549 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r c0852f6d0549 https://go.googlecode.com/hg/ #
MessagesTotal messages: 15
|