RE: [Haskell-cafe] Re: Hugs vs GHC (again) was: Re: Somerandomnewbiequestions

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

Simon Marlow wrote:
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)).
Original and descriptor returned by dup or dup2 share file pointer. -- Gracjan
participants (2)
-
Gracjan Polak
-
Simon Marlow