From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 66D52BC6B for ; Tue, 18 Sep 2007 02:35:29 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAE667kbAXQImn2dsb2JhbACOEwIHBAYHCBg X-IronPort-AV: E=Sophos;i="4.20,266,1186351200"; d="scan'208";a="1331617" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 18 Sep 2007 02:36:30 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l8I0Zppp009199 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 18 Sep 2007 02:35:56 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAMa67kZQW+UCh2dsb2JhbACOEwkKJw X-IronPort-AV: E=Sophos;i="4.20,266,1186351200"; d="scan'208";a="2836729" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail3-smtp-sop.national.inria.fr with ESMTP; 18 Sep 2007 02:36:20 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IXQv4-0007HM-3q for caml-list@inria.fr; Tue, 18 Sep 2007 02:26:26 +0200 Received: from ivr94-8-88-162-26-239.fbx.proxad.net ([88.162.26.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Sep 2007 02:26:26 +0200 Received: from li by ivr94-8-88-162-26-239.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Sep 2007 02:26:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Zheng Li Subject: Re: [ANN] coThreads 0.10 Date: Tue, 18 Sep 2007 02:16:31 +0200 Message-ID: <87ejgwn7z4.fsf@pps.jussieu.fr> References: <87lkb5fe3f.fsf@pps.jussieu.fr> <87sl5d8cgd.fsf@pps.jussieu.fr> <1190050760.6058.80.camel@rosella.wigram> <87odg16uzh.fsf@pps.jussieu.fr> <1190064830.6058.255.camel@rosella.wigram> <873axc7wan.fsf@pps.jussieu.fr> <1190071600.22073.7.camel@rosella.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: ivr94-8-88-162-26-239.fbx.proxad.net User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:nOyqMUTotRNoyI5HPGZsjn78ES0= Sender: news X-Miltered: at discorde with ID 46EF1D67.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0200,:01 users':01 ocaml:01 mutable:01 0.10:98 threads:01 threads:01 sourceforge:01 wrote:01 pps:01 pps:01 immutable:01 immutable:01 jussieu:01 jussieu:01 skaller writes: > On Tue, 2007-09-18 at 00:37 +0200, Zheng Li wrote: >> For immutable value, it's not different from the traditional threads, at least >> from the library users' point of view: if a variable is already inside the >> scope of a threads (i.e. it's global and created before launching the thread), >> there is no necessity to message passing it; if not, you should anyway do it >> explicitly even with the traditional threads. > > Yes, however such a value can't be shared by parallel control paths > (in ocaml) because the collector won't allow it. Of course > you can *copy* it eg with fork() and run separate collectors. Given that the copy-on-write strategy is widely adopted in the *nix family, I hope it's not a big problem. > Then the functional value is the same, but the object identity > (machine address) may differ. Yes. For immutable value, physical equivalence is not preserved across *multiple* rounds of message passing. This is another slight semantic difference I should document on the pitfall page. As mutable value, if shared through STM, their inter-references are actually preserved. -- Zheng Li http://www.pps.jussieu.fr/~li