[MLton] Transactions for ML

Suresh Jagannathan suresh at cs.purdue.edu
Thu Apr 19 17:31:06 PDT 2007


On Apr 19, 2007, at 4:48 PM, Matthew Fluet wrote:
>>
>
> Philip, Lukasz, and Suresh should have some opinions; their ICFP06  
> paper on Stabilizers implemented something like transactions for  
> MLton.
>

As Matthew rightly points out, the stabilizer implementation is  
easily adapted to support
concurrent transactions.  Our current implementation provides an STM  
interface that
implements a pessimistic write/optimistic read incarnation, although  
we have
experimented in the past with an optimistic (logging) write version  
as well.  Other
than  lightweight read and write barriers used for version  
management,  the implementation
is expressed entirely in SML, and requires no modfications to  
MLton.   The overheads  are
essentially the same as reported in the ICFP paper.

Of course, porting this implementation to a multiprocessor/multi-core  
environment is
significantly more challenging, requiring modifying the garbage  
collector, atomic
primitives, the operation of the scheduler, basis library  
implementation,
etc.  These modifications are necessary for any application that  
supports multiple
parallel threads of execution, and are not specific to STM, which  
after all is just a
concurrency control mechanism.

-- Suresh



More information about the MLton mailing list