caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <damien.doligez@inria.fr>
To: "Björn Pelzer" <bpelzer@uni-koblenz.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Understanding GC and Alarms
Date: Wed, 5 Aug 2009 16:33:47 +0200	[thread overview]
Message-ID: <1A0EB2E6-C9D8-478D-A266-806C5F74CA90@inria.fr> (raw)
In-Reply-To: <4A783A0D.5080906@uni-koblenz.de>

Hello,

On 2009-08-04, at 15:39, Björn Pelzer wrote:

> With the alarm loop, the GC will only print the first part ("Calling  
> finalisation functions.") once at the start of the loop and then  
> begin looping, starting new cycles but no new finalisations.

Yes, the GC calls the finalisation functions in order, so it waits for  
your
finalisation function to finish before starting the next one.  If your
function doesn't terminate...

> The other (and to me more severe) oddity is that if the alarm  
> function raises an exception, then the GC seems to remain in its  
> "special mode" where it starts no finalisation calling - but now it  
> will also refuse to do any alarms.

Yes, that is the essence of bug report 4742:
< http://caml.inria.fr/mantis/view.php?id=4742 >

> Is there a way to get the GC back to normal after an exception  
> during the alarm?

That is the purpose of the Gc.finalise_release function: tell the GC  
to behave
as if the current finalisation function had finished.  Note that  
finalise_release
is also safe to call from outside a finalisation function, so you can  
call it
from your exception handler.

When bug 4742 is fixed (probably in 3.12.0), you won't need it any more.
Note that I wanted to fix it by ignoring the exception entirely, but
your use case made me change my mind.

-- Damien


  reply	other threads:[~2009-08-05 14:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-04 13:39 Björn Pelzer
2009-08-05 14:33 ` Damien Doligez [this message]
2009-08-05 15:04   ` [Caml-list] " Björn Pelzer

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=1A0EB2E6-C9D8-478D-A266-806C5F74CA90@inria.fr \
    --to=damien.doligez@inria.fr \
    --cc=bpelzer@uni-koblenz.de \
    --cc=caml-list@yquem.inria.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;
as well as URLs for NNTP newsgroup(s).