[Haskell] Haskell as a disruptive technology?

Tim Harris tharris at microsoft.com
Thu Mar 30 05:39:34 EST 2006


> I had to chuckle at this one in particular, since the implementation
> of transactions in Haskell was based on experiences with prototype
> software TM in Java and C#!  In truth, Haskell adds a few things to
> the mix that make STM dramatically better.  Most important are STM
> and STRef---it's no longer possible to accidentally commingle
> transactional and non-transactional access to the same storage, or to
> do I/O in the middle of a transaction by mistake.  

I don't think that the Haskell STM implementation is as closely based on
the Java / C# work as it appears...

Before Simon Marlow's SMP extensions we relied on there being only a
single thread running in an STM operation in the RTS at any time, so the
STMCommit operation could run without interference.  

Even with SMP support, and the possibility of multiple threads in the
RTS, we've never aimed for non-blocking progress because we assume that
the number of OS threads will be tuned to the number of available cores.

As well as the use of the STM monad to separate out IO/tx/non-tx access,
I think the big thing that we learnt from the Haskell work was the
retry/orElse abstractions for composable blocking.

BTW, I've put a copy of another recent STM-Haskell paper online at
It's about defining invariants over transactionally-managed data
structures -- feedback's very welcome!



More information about the Haskell mailing list