
11 Jan
2005
11 Jan
'05
7:39 a.m.
On 11 January 2005 11:39, Marcin 'Qrczak' Kowalczyk wrote:
Ben Rudiak-Gould
writes: "fileRead :: File -> FileOffset -> Integer -> Buffer -> IO ()"
This is unimplementable safely if the descriptor is read concurrently by different processes. The current position is shared.
There's a big lock on File. If you want to do truly concurrent reading, you can make multiple FileInputStreams, each of which has its own file descriptor (the Unix implementation uses dup(2)). Cheers, Simon