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

Glynn Clements glynn at gclements.plus.com
Wed Jan 19 15:30:36 EST 2005


Keean Schupke wrote:

> >>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.
> 
> I think this is not true on linux, where a thread is just a process created
> with special flags to keep the same fds and memory.
> 
> As threads on linux are scheduled like processes, one thread blocking should
> not affect the others?

That should be true of all POSIX-like thread implementations
(including Linux, whose threads aren't quite POSIX-compliant, e.g. in
regard to signal handling, but aren't that far off).

Essentially, blocking system calls only block the calling kernel
thread.

OTOH, if you are implementing multiple user-space threads within a
single kernel thread, if that kernel thread blocks, all of the
user-space threads within it will be blocked.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the Haskell-Cafe mailing list