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

Simon Marlow simonmar at microsoft.com
Tue Jan 11 07:39:09 EST 2005


On 11 January 2005 11:39, Marcin 'Qrczak' Kowalczyk wrote:

> Ben Rudiak-Gould <Benjamin.Rudiak-Gould at cl.cam.ac.uk> writes:
> 
>>     http://www.haskell.org/~simonmar/io/System.IO.html
> 
> "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


More information about the Haskell-Cafe mailing list