Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: [Caml-list] STM support in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-03-08 (10:39)
From: Asfand Yar Qazi <email@a...>
Subject: Re: [Caml-list] STM support in OCaml
yoann padioleau wrote:
>>>You make several claims:
>>>STM is not lock free.
>>>STM is not useful on a small number of processors
>>>As for claim 1.  "Lock-free" doesn't mean what you think it does. 
>>I know what STM does, thank you: I intend to implement it
>>myself in my own programming language. Maybe you should
>>read more carefully.
>>I said "protected by a mutex under the hood." which means
>>sure, the programmer is not writing locks, but they're used
>>in the implementation and the associated costs are still paid.
> I have read (very fastly) the atomcaml paper and I don't think they use "mutex under the hood".
> It seems that they just log stuff and rollback. I guess that when you want to implement 
> STM on multiprocessor you may need to mutex stuff (the internal data structures maintained by the STM runtime),
> but as ocaml runtime does not use multiprocessor, they dont need it.

Also, from what I remember, STM is "optimistic", while conventional lock-based 
design is "pessimistic" - thereby allowing STM based code to spend less time 
checking for locks or something, which apparently makes it quicker.

But, I'll lets the experts explain it :-)