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 2F5C7BB81 for ; Wed, 8 Mar 2006 12:32:44 +0100 (CET) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.173]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k28BWh8a003802 for ; Wed, 8 Mar 2006 12:32:44 +0100 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1FGwu6-00049z-00; Wed, 08 Mar 2006 12:32:30 +0100 Received: from [84.58.132.179] (helo=gate.lan.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1FGwu6-0000pa-00; Wed, 08 Mar 2006 12:32:30 +0100 Received: from flakew.lan.gerd-stolpmann.de (flakew.lan.gerd-stolpmann.de [192.168.0.32]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id EC77EC018; Wed, 8 Mar 2006 12:32:29 +0100 (CET) Subject: Re: [Caml-list] STM support in OCaml From: Gerd Stolpmann To: padator@wanadoo.fr Cc: skaller , Asfand Yar Qazi , caml-list@yquem.inria.fr In-Reply-To: <1474655.1141812700555.JavaMail.www@wwinf1632> References: <1474655.1141812700555.JavaMail.www@wwinf1632> Content-Type: text/plain Date: Wed, 08 Mar 2006 12:32:29 +0100 Message-Id: <1141817549.10771.63.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:a6865a839c0178d9aa0ce41878507ea2 X-Miltered: at nez-perce with ID 440EC0DB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 gerd:01 stolpmann:01 runtime:01 ocaml:01 runtime:01 scheduler:01 bytecode:01 mutexes:01 buffer:01 scheduler:01 mutexes:01 real-world:01 gerd:01 stolpmann:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 Am Mittwoch, den 08.03.2006, 11:11 +0100 schrieb yoann padioleau: > > > 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. In Atomcaml, the question whether there is a mutex or not simply does not matter. They have their own scheduler (for bytecode), so there is no need to have additional mutexes to protect the data structures Atomcaml needs for itself, e.g. the log buffer. Being the scheduler is better than any mutual exclusion... If you ported Atomcaml to a kernel-level scheduler, you would surely need mutexes (even in the uniprocessor case), simply because you need to synchronize the kernel scheduler with user-level atomicity management. So yes, for any real-world implementation, there are "mutexes under the hood". Anyway, I think this question is misleading. The point is not to establish locking schemes that use the hardware better (i.e. that are faster), but to help programmers writing correct code. Gerd -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------