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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id A134CBBAF for ; Tue, 12 Oct 2010 11:25:34 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: An4BAA/Gs0zRVdivkGdsb2JhbAChSggVAQEBAQkJDAcRAx+hf4lKghiGfS6IVgEBAwWFQwSKQYVp X-IronPort-AV: E=Sophos;i="4.57,319,1283724000"; d="scan'208";a="73189144" Received: from mail-qy0-f175.google.com ([209.85.216.175]) by mail4-smtp-sop.national.inria.fr with ESMTP; 12 Oct 2010 11:25:34 +0200 Received: by mail-qy0-f175.google.com with SMTP id 30so579219qyk.6 for ; Tue, 12 Oct 2010 02:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=fo9CVYfRmdjXtgO0PQOuGt8PK/22EjxKKcTfikb/v/c=; b=QOfuVdhyaPr+qKIWVkwUQN6CPG1wQYdSB+yRtwbHiQMlk1NNB8SKDwBE8yo967taAG vo+zQ0ws5dodWVDwlnw0KreKCD8Q0q17fou29o8xfqRdQx0WpoU7IjkPGWoT8+oME5HZ M2NkgZ1kSp//wzciguSkb0MSKE0IlxHvZbxZg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=EAAu3fcWvO8VZ0vRNFNSYgWZJiFztymAe7942FqQrtrIRQTqgO53+ndflNSc4whhiW JdIVjeo89ND/mYeNxdJP3fmK4CqurmRTBaj4hK/F1eVe+Ubyh+bi1lwr4j+nos0WAiq/ xXIzBfTKihqjTuIhF3Vn67Gh2aZNXLdiryddc= MIME-Version: 1.0 Received: by 10.229.100.18 with SMTP id w18mr6097371qcn.120.1286875533080; Tue, 12 Oct 2010 02:25:33 -0700 (PDT) Received: by 10.229.25.209 with HTTP; Tue, 12 Oct 2010 02:25:32 -0700 (PDT) In-Reply-To: References: <1286545686.19478.40.camel@bohrium.pps.jussieu.fr> Date: Tue, 12 Oct 2010 11:25:32 +0200 Message-ID: Subject: Re: [Caml-list] Marshalling question From: Julien Signoles To: Alexey Rodriguez Cc: Mathias Kende , caml users Content-Type: multipart/alternative; boundary=0016364d298904fb2b0492680fe2 X-Spam: no; 0.00; marshalling:01 signoles:01 signoles:01 marshalling:01 mathias:98 mathias:98 carey:98 wrote:01 wrote:01 abstract:01 abstract:01 graph:01 graph:01 exception:01 exception:01 --0016364d298904fb2b0492680fe2 Content-Type: text/plain; charset=ISO-8859-1 Hello, 2010/10/12 Alexey Rodriguez > On Fri, Oct 8, 2010 at 3:48 PM, Mathias Kende > wrote: > > > Exception are some complex datastructure which may require additional > > care when marshalled. An example of which are the graphs of the > > ocamlgraph library (even the functional one), but there is none in the > > standard library. > > Mathias, can you elaborate on "additional care"? We are using the > functional graphs from ocamlgraph, so I am very interested in your > experiences with it. > To my knowledge, issues come with the so-called "abstract" graphs from OcamlGraph in which vertices have unique ids. 1) if there are abstract vertices in RAM while unmarshalling some others, you have to be sure that RAM vertices do not share ids with unmarshalled ones (except if you really want that). 2) Before creating new abstract vertices, you have to set the global id counter Graph.Blocks.cpt_vertex in the right way (by marshalling it and by calling Graph.Blocks.after_unserialization after unmarshalling). I'm not aware of any other (un)marshalling issue with OcamlGraph datastructures. Beyond OcamlGraph, similar issues potentially exist for any datastructure which uses unique ids as keys and/or hashconsing techniques. For instance, a quite big job is done for solving this issue in Frama-C (http://frama-c.com) which uses many hashconsed datastructures (included abstract ocamlgraph vertices, but only the above-mentioned issue 2 applies in the Frama-C context) Hope this helps, Julien Signoles --0016364d298904fb2b0492680fe2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

2010/10/12 Alexey Rodriguez <mrchebas@gmail.com>
On Fri, Oct 8, 2010 at 3:48 PM, Mathias Kende <mathias.kende@ens.fr> wrote:

> Exception are some complex datastructure which may require additional<= br> > care when marshalled. An example of which are the graphs of the
> ocamlgraph library (even the functional one), but there is none in the=
> standard library.

Mathias, can you elaborate on "additional care"? We are usi= ng the
functional graphs from ocamlgraph, so I am very interested in your
experiences with it.

To my knowledge, issues come = with the so-called "abstract" graphs from OcamlGraph in which ver= tices have unique ids.
1) if there are abstract vertices in RAM while u= nmarshalling some others, you have to be sure that RAM vertices do not shar= e ids with unmarshalled ones (except if you really want that).
2) Before creating new abstract vertices, you have to set the global id cou= nter Graph.Blocks.cpt_vertex in the right way (by marshalling it and by cal= ling Graph.Blocks.after_unserialization after unmarshalling).
I'm no= t aware of any other (un)marshalling issue with OcamlGraph datastructures.<= br>
Beyond OcamlGraph, similar issues potentially exist for any datastructu= re which uses unique ids as keys and/or hashconsing techniques. For instanc= e, a quite big job is done for solving this issue in Frama-C (http://frama-c.com) which uses many hashconsed datast= ructures (included abstract ocamlgraph vertices, but only the above-mention= ed issue 2 applies in the Frama-C context)

Hope this helps,
Julien Signoles
--0016364d298904fb2b0492680fe2--