From: Bertrand Jeannet <Bertrand.Jeannet@inria.fr>
To: "François Bobot" <francois.bobot@cea.fr>, caml-list@inria.fr
Subject: Re: [Caml-list] Ephemerons: is this behavior correct ?
Date: Mon, 10 Oct 2016 18:49:59 +0200 [thread overview]
Message-ID: <57FBC6B7.8020407@inria.fr> (raw)
In-Reply-To: <2eb2cf19-6ad8-ee9d-9b76-a71c0d5ed7c2@cea.fr>
Le 10/10/2016 15:38, François Bobot a écrit :
> Hi Bertrand,
>
> On 10/10/2016 15:14, Bertrand Jeannet wrote:
>> The following piece of code raises an assert false exception (in rare
>> cases) with official version 4.03.0:
>>
>> match Ephemeron.K1.get_data c with
>> | Some _ ->
>> match Ephemeron.K1.get_key c with
>> | Some _ -> (* ... *)
>> | None -> assert false (* reachable *)
> >
>> The documentation of the Ephemeron module says:
>> "When one of the keys is not considered alive anymore by the GC, the
>> data is emptied from the ephemeron"
>>
>> I was expecting this to happen atomically from the programmer point of
>> view,
> Yes, atomicity is the intent.
>
>> but here apparently the key was emptied but the data kept (at
>> least temporarily).
>
> I don't deduce that from the example. The cleaning can be done
> atomically between the return of get_data and the return of get_key
> (indeed get_key does an allocation).
Hi Francois,
Thank you for the explanation. I missed the point that a reachable data
value does not prevent the key and the data fields to be emptied (it is
explicitly mentioned in the documentation).
Best regards
Bertrand
prev parent reply other threads:[~2016-10-10 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-10 13:14 Bertrand Jeannet
2016-10-10 13:38 ` François Bobot
2016-10-10 16:49 ` Bertrand Jeannet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57FBC6B7.8020407@inria.fr \
--to=bertrand.jeannet@inria.fr \
--cc=caml-list@inria.fr \
--cc=francois.bobot@cea.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox