Hugsvs GHC (again)was: Re: Somerandomnewbiequestions
simonmar at microsoft.com
Wed Jan 19 08:39:05 EST 2005
On 19 January 2005 09:45, Ben Rudiak-Gould wrote:
> Glynn Clements wrote:
> >Ben Rudiak-Gould wrote:
> >>GHC really needs non-blocking
> >>I/O to support its thread model, and memory-mapped I/O always
> blocks. >
> >If, by "blocks", you mean that execution will be suspended until the
> >data has been read from the device into the buffer cache, then Unix
> >non-blocking I/O (i.e. O_NONBLOCK) also blocks.
> Okay, my ignorance of Posix is showing again. Is it currently the
> case, then, that every GHC thread will stop running while a disk read
> is in progress in any thread? Is this true on all platforms?
It's true on Unix-like systems, I believe. Even with -threaded. It
might not be true on Win32.
> (By the way, are the GHC folks aware that the description of Win32 I/O
> at  is wrong? It seems to assume that ReadFile doesn't return until
> the buffer is full.)
I don't think that description corresponds with the implementation, but
then I'm not terribly familiar with that part of the code. It doesn't
get used when -threaded is on.
More information about the Haskell-Cafe