[Haskell-cafe] Re: catting to cat gets stuck at > 135K
Donn Cave
donn at avvanta.com
Fri Nov 28 13:22:13 EST 2008
Quoth Duncan Coutts <duncan.coutts at worc.ox.ac.uk>:
| On Thu, 2008-11-27 at 11:38 -0500, Brandon S. Allbery KF8NH wrote:
|
|> The way this is usually handled in the non-threaded case is to either
|> use SIGCHLD or non-blocking waitpid() so that "green" threads can
|> continue running. I'm a little surprised this wasn't done.
|
| Yes, we've discussed this in detail a few months back. We even have a
| partial implementation. However it stalled on needing a better signals
| API which we have not managed to get through the standardisation
| process.
|
| Unfortunately there is no non-blocking (non-polling) waitpid() and the
| global (process-scope) nature of signals is a pain.
SIGCHLD can be a pain in its own unusual way. Once you have a SIGCHLD
handler, process exits will interrupt "long" I/O, so every such read(),
recv() or whatever must now check for EINTR and restart. Even though
the authors of GHC go to great lengths to convert all I/O to non-blocking
anyway, this will still apply to external library functions that are
beyond GHC's reach. So it's a strategy I would use only if I were kind
of desperate.
Donn
More information about the Haskell-Cafe
mailing list