[MLton] inferring getAndSet via an Atomic{Begin, End} optimization

Henry Cejtin henry.cejtin at sbcglobal.net
Thu Aug 31 15:19:13 PDT 2006


I am slightly confused about a few things in the Atomic Begin and End code.

    Why  does AtomicBegin set limit?  I assume that this causes signals to be
        handled as soon as the next GC safe point comes  up,  but  you  don't
        want that to happen if you are in a critical region.

        If it has to be done, wouldn't it be better to do it in AtomicEnd, so
        it is later (i.e., to catch cases where the signal arrived during the
        critical region)?

    I  assume  that the last line in AtomicEnd was supposed to call gc (i.e.,
        () added just before the semicolon).



More information about the MLton mailing list