From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 78E8FBB81 for ; Tue, 7 Mar 2006 18:12:41 +0100 (CET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k27HCdZP032360 for ; Tue, 7 Mar 2006 18:12:40 +0100 Received: from [192.168.1.200] (ppp9-113.lns1.syd7.internode.on.net [59.167.9.113]) by smtp3.adl2.internode.on.net (8.13.5/8.13.5) with ESMTP id k27HCPEU005329; Wed, 8 Mar 2006 03:42:26 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] STM support in OCaml From: skaller To: Asfand Yar Qazi Cc: caml-list@yquem.inria.fr In-Reply-To: <440DB255.1030701@asfandyar.cjb.net> References: <440DB255.1030701@asfandyar.cjb.net> Content-Type: text/plain Organization: Async P/L Date: Wed, 08 Mar 2006 04:15:08 +1100 Message-Id: <1141751708.20944.355.camel@budgie.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 440DBF07.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 haskell:01 afaik:01 bounded:01 combinator:01 async:01 2006:98 consultants:98 wrote:01 sourceforge:01 sourceforge:01 caml-list:01 realtime:01 variables:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Tue, 2006-03-07 at 16:18 +0000, Asfand Yar Qazi wrote: > Hi, > > I've temporarily decided to leave off learning OCaml (although I still intend > to learn it at some point) and start learning Haskell due to its support for > Software Transactional Memory and lock-free concurrent programming. AFAIK STM is not lock free. It simply limits the locking period to a bounded time, at the expense of the whole transaction taking unbounded time. The final compare/write/retry must be atomic and is therefore protected by a mutex under the hood. Sebastian Egner said in another post the main advantage of STMs: they have a combinator form, that is, they can be composed. However, despite the lack of safety in a bolt on addition for Ocaml .. the real problem is that STM isn't that useful unless you have (a) a lot of processors (b) a lot of variables so that the risk of contention is low and the cost of long exclusions is high. Ocaml fails to satisfy property (a) since it doesn't support multi-processing. -- John Skaller Async PL, Realtime software consultants Checkout Felix: http://felix.sourceforge.net