[MLton] cvs commit: MAIL: PosixError.SysCall changes

Stephen Weeks MLton@mlton.org
Mon, 3 May 2004 09:13:23 -0700

> I'm happy enough to drop the optimization, but I haven't benchmarked or
> looked at the SSA code.  While there is only one more cheap test, the fact
> that we introduce a loop and additional control-flow probably impacts the
> resulting code.

True.  It could be a lot of code, which could have other, more subtle
effects (putting stuff in stack frames, register allocation, etc).  I
don't think it's worth dropping now that it's already done.  We should
just keep it in mind so that we can drop the {restart = false}
optimization when we encounter syscalls on other platforms that return
EINTR more than we see know on Linux.  I guess it won't be too hard to
detect the error should it arise in the future, since we will see the
SysErr exception with EINTR.

> I was just pointing out that even when we are doing a restart, it's much
> better than block/unblock, which was the alternative before adding
> SysCall.* functions.

Ahh.  Good point.  It is a nice property of the direction the signal
handler implementation has taken that we need so little blocking and
that we can do so much with critical sections.