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.4 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id A8EDEBBAF for ; Thu, 24 Sep 2009 18:05:29 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag4CAAM2u0qEqOABmWdsb2JhbACafwEBAQEBCAsKBxO8JYQbBQ X-IronPort-AV: E=Sophos;i="4.44,446,1249250400"; d="scan'208";a="36756550" Received: from oxalide-out.extra.cea.fr ([132.168.224.1]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2009 18:05:29 +0200 Received: from pisaure.intra.cea.fr (pisaure.intra.cea.fr [132.166.88.21]) by oxalide.extra.cea.fr (8.14.2/8.14.2/CEAnet-Internet-out-2.0) with ESMTP id n8OG5SJT021996 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 24 Sep 2009 18:05:28 +0200 Received: from muguet1.intra.cea.fr (muguet1.intra.cea.fr [132.166.192.6]) by pisaure.intra.cea.fr (8.14.2/8.14.2) with ESMTP id n8OG5SoX023381 for ; Thu, 24 Sep 2009 18:05:28 +0200 (envelope-from Pascal.Cuoq@cea.fr) Received: from is005030.intra.cea.fr (is005030.intra.cea.fr [132.166.132.11]) by muguet1.intra.cea.fr (8.13.8/8.13.8/CEAnet-Intranet-out-1.1) with ESMTP id n8OG5SkE022760 for ; Thu, 24 Sep 2009 18:05:28 +0200 Message-Id: <5D7DF789-5EE6-4432-92A2-673F2D02FCD7@cea.fr> From: Pascal Cuoq To: caml-list@yquem.inria.fr In-Reply-To: <20090924154716.BCD0ABC5A@yquem.inria.fr> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Caml-list] OC4MC : OCaml for Multicore architectures Date: Thu, 24 Sep 2009 18:02:57 +0200 References: <20090924154716.BCD0ABC5A@yquem.inria.fr> X-Mailer: Apple Mail (2.936) X-Spam: no; 0.00; cuoq:01 cuoq:01 ocaml:01 threads:01 threads:01 wrote:01 heap:01 heap:01 caml-list:01 cea:01 checking:02 mutex:03 sequentially:04 debug:05 anyway:05 On Sep 24, 2009, at 5:47 PM, Philippe Wang wrote: >> Is the copy operation parallelized? > > Nope. When the world is stopped for the collection, everything is done > sequentially until the world is resumed. > I don't think it's relevant to parallelize the copy operation (hell to > implement&debug, then I don't think that performance would be very > interesting because we would probably need a write mutex on the > destination heap) Well, you could start copying to the bottom of the next heap with one thread going up and to the top of it with another going down. Assume optimistically that the two threads will not reach the same cacheline at the end of the copies, and you don't need any synchronisation at all between them, except joining at the end. After checking, if they have reached the same cacheline, you need to reallocate the destination heap anyway. You still get a single unfragmented free block as a result. Even better: stop the world just before there remains less that one cacheline of free space and you don't need to check if the two threads have met. You still need to reallocate the destination heap sometimes though. Oh, and I meant to say, but everyone else was faster than me: well done! Pascal