[Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions
k.schupke at imperial.ac.uk
Thu Jan 20 04:56:02 EST 2005
Why is disk a special case? I have never heard that all processes under
wait for a disk read... The kernel most certainly does not busy wait for
to respond, so the only alternative is that the process that needs to wait
(and only that process) is put to sleep. In which case a second thread would
Linux does not busy wait in the Kernel! (don't forget the kernel does
so it could be that read really does return 'immediately' and without
apart from at the end of file - In which case asynchronous IO just slows
with extra context switches).
Simon Marlow wrote:
>On 19 January 2005 16:58, Keean Schupke wrote:
>>Simon Marlow wrote:
>>>This is what GHC does, if I understand you correctly. The thread
>>>running select() does so in its own OS thread, while another OS
>>>thread runs the Haskell code. As long as you use -threaded, that
>>>is. Oh, and before GHC 6.4 it was done a different way - the
>>>scheduler used to do the select() between running Haskell threads.
>>So this means even though the IO calls block, the other Haskell
>>threads (when run with -threaded) keep running?
>Yes, unless the IO is to/from disk on a Unix system.
More information about the Haskell-Cafe