[MLton] interrupted system call
Henry Cejtin
henry@sourcelight.com
Wed, 24 Mar 2004 13:03:48 -0600
re too expensive, my interpretation of Matthews thought was that we alway run
with all signals blocked (more on that below), but when the current code
checks to see if a signal has occured, instead we unblock the signals and
then immediately reblock them and then check the flag. This way system calls
would be un-interruptable, but that must be true any way because the ML
handler can't be run then, and we get the right behavior for free.
The problem is that unblocking and then reblocking signals would mean two
system calls (both sigblock()) and that is probably too expensive.
With regards to `all signals blocked', note that C libraries must be handling
interrupts. I guess that the right thing would be to only block signals that
are handled by ML code.
I'm still a bit nervous about this. Note, signals are really quite a botch
in Unix.