[MLton-user] Re: MLton signal handling broken on Windows (was: CML and foreign code)

Ivan Tomac ivan.tomac at gmail.com
Fri Sep 30 04:06:49 PDT 2011


I've been trying to debug this and I think I found the problem. In
runtime/platform/mingw.c, in function fixPriority, commenting out
SetThreadPriority so far appears to stop the crashes.

I'm not sure how much of an issue commenting that line out will be
with respect to performance. I've done a bit of research online and it
seems Win32 has no decent APIs for high resolution timers. I'll do
some tests and see if I can find something more reliable.


On Fri, Sep 30, 2011 at 7:08 AM, Ivan Tomac <ivan.tomac at gmail.com> wrote:
> I've done some more testing and it appears the problem is not specific
> to foreign code. MLton's signal handling is broken under Windows.
> I've tested both the very latest version out of SVN built with gcc
> 4.6.1 as well as the Mingw binary distribution release 20100608 from
> mlton.org, both 32-bit and 64-bit code.
>
> The preemptive threads example from http://mlton.org/MLtonThread
> sometimes works and sometimes crashes (I've just counted 10 runs and
> had 2 success messages and 8 crashes).
> As far as I can tell the non-preemptive threads example works every
> time and the main difference between them is signal handling code.
>



More information about the MLton-user mailing list