From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 070B3BC3F for ; Sat, 30 Oct 2004 02:32:55 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i9U0WsIB031502 for ; Sat, 30 Oct 2004 02:32:54 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA32109 for ; Sat, 30 Oct 2004 02:32:54 +0200 (MET DST) Received: from mail.davidb.org (adsl-64-172-240-129.dsl.sndg02.pacbell.net [64.172.240.129]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i9U0Wp3j006917 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 30 Oct 2004 02:32:53 +0200 Received: from davidb by mail.davidb.org with local (Exim 4.42 #1 (Debian)) id 1CNhAn-00030a-11; Fri, 29 Oct 2004 17:32:49 -0700 Date: Fri, 29 Oct 2004 17:32:49 -0700 From: David Brown To: skaller Cc: David Brown , Ker Lutyn , caml-list Subject: Re: [Caml-list] atomicity guarantees for threaded code Message-ID: <20041030003249.GA11524@old.davidb.org> References: <20041029163907.36287.qmail@web40611.mail.yahoo.com> <20041029215027.GA9504@old.davidb.org> <1099094075.11063.215.camel@pelican.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1099094075.11063.215.camel@pelican.wigram> User-Agent: Mutt/1.5.6i X-Miltered: at concorde with ID 4182E136.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4182E134.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 caml-list:01 wrote:01 threads:01 byte:01 alignment:01 ocaml:01 aligned:01 aligned:01 threaded:03 long:04 entries:05 probably:05 suspect:07 dave:08 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: On Sat, Oct 30, 2004 at 09:54:37AM +1000, skaller wrote: > > As long as the reference write is atomic, which it is going to be, I would > > suspect this is safe. It probably would even be safe if multiple threads > > updated the reference, but you might just drop entries. > > It isn't clear though. On x86 you can have 1 byte alignment > for an address. What happens if: But, a reference in ocaml will always be in a block, which will always be aligned. Even x86 will be atomic with a 32-bit transfer that is aligned. Dave