On Thu, Jun 11, 2009 at 2:30 AM, Ketil Malde <ketil@malde.org> wrote:

Hi,

Browsing LWN, I ran across this comment:

http://lwn.net/Articles/336039/

The author makes a bunch of unsubstantiated claims about STM, namely
that all implementations use locking under the hood, and that STM can
live- and deadlock.  I've seen a lot of similar sentiments in other
places as well (comp.arch springs to mind).

Now, I'm no expert on STM, but I was pretty sure these are incorrect,
and I certainly had the impression that Haskell's STM guarantees some
progress - which it couldn't in a deadlock situation.

MVars can be simulated with STM, and MVars can semantically get in a deadlock situation, so STM can also deadlock.

Admittedly, if you're using STM to simulate MVars, you're doing it wrong.

Luke