writeFile/readFile on multiple threads leads to error
Neil Mitchell
ndmitchell at gmail.com
Wed Apr 22 09:32:01 EDT 2009
Bulat: I haven't tried moving to Posix calls, I'll try that next -
although I was hoping the application wouldn't be posix dependent.
>> readFile calls openFile >>= hGetContents. It's the openFile that
>> causes the problem, so READ START happens before openFile and READ
>> STOP happens after openFile. The lazy semantics of the actual reading
>> don't seem to have an effect.
>
> Just want to make sure that it isn't the latent hClose from readFile.
Yeah, I've done that before! It seems to be the writeFile that isn't
closing, not the readFile - hence my surprise.
>> I did try changing to the strict bytestring file read, and that gave
>> exactly the same error - apart from openBinaryFile was crashing rather
>> than openFile.
>
> Weren't there versions of bytestring that didn't close the file early
> enough?
I only used bytestring for reading, so it shouldn't have made any difference.
Thanks
Neil
More information about the Glasgow-haskell-users
mailing list