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=0.0 required=5.0 tests=AWL 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 76215BC6B for ; Tue, 18 Sep 2007 01:26:10 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPKp7kbLENaMnmdsb2JhbACOEwIHBAYPGA X-IronPort-AV: E=Sophos;i="4.20,266,1186351200"; d="scan'208";a="1330269" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 18 Sep 2007 01:27:11 +0200 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l8HNQY61008411 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 18 Sep 2007 01:26:39 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPKp7kbLENaMnmdsb2JhbACOEwIHBAYPGA X-IronPort-AV: E=Sophos;i="4.20,266,1186351200"; d="scan'208";a="1330266" Received: from ipmail01.adl2.internode.on.net ([203.16.214.140]) by mail2-smtp-roc.national.inria.fr with ESMTP; 18 Sep 2007 01:27:10 +0200 X-IronPort-AV: E=Sophos;i="4.20,266,1186324200"; d="scan'208";a="193053826" Received: from ppp121-44-123-220.lns10.syd6.internode.on.net (HELO [192.168.1.201]) ([121.44.123.220]) by ipmail01.adl2.internode.on.net with ESMTP; 18 Sep 2007 08:56:41 +0930 Subject: Re: [Caml-list] Re: [ANN] coThreads 0.10 From: skaller To: Zheng Li Cc: caml-list@inria.fr In-Reply-To: <873axc7wan.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> Content-Type: text/plain Date: Tue, 18 Sep 2007 09:26:40 +1000 Message-Id: <1190071600.22073.7.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46EF0D2A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0200,:01 users':01 ocaml:01 parser:01 parses:01 0.10:98 threads:01 threads:01 sourceforge:01 wrote:01 parsing:01 caml-list:01 immutable:01 explicitly:02 functional:02 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. Then the functional value is the same, but the object identity (machine address) may differ. BTW: an interesting application would be to adapt GLR parser to actually use multi-core CPU to speed up parsing by spawning alternate parses as parallel control streams. -- John Skaller Felix, successor to C++: http://felix.sf.net