From: Andy Wingo <wingo@pobox.com>
To: ludo@gnu.org (Ludovic Courtès)
Cc: "guile-devel@gnu.org" <guile-devel@gnu.org>
Subject: Re: allocation within critical sections
Date: Sun, 19 Feb 2012 10:42:49 +0100 [thread overview]
Message-ID: <87ty2n17mu.fsf@pobox.com> (raw)
In-Reply-To: <87hayp12yr.fsf@gnu.org> ("Ludovic Courtès"'s message of "Fri, 17 Feb 2012 23:59:08 +0100")
On Fri 17 Feb 2012 23:59, ludo@gnu.org (Ludovic Courtès) writes:
> Andy Wingo <wingo@pobox.com> skribis:
>
>> Ooooh, good one. A bug in Guile, this one, and tricky to get around.
>> Of course, running finalizers in a separate thread will solve it.
>
> It’s about [deferring] user-provided finalizer execution, no?
I think that's a limiting way to look at the problem -- it's really
about running finalizers within a context in which no other locks are
held. See the "Destructors, Finalizers, and Synchronization" paper from
Boehm.
> What about using asyncs for that? For instance, scm_i_finalize_smob
> make a [deferred], instead of direct, call to the SMOB’s ‘free’, via
> scm_i_queue_async_cell.
It's an interesting idea. I suspect that it only defers the problem,
though: if we start running finalizers through asyncs, we'll run into
problems with locks at the scheme level.
That is to say, just because you are in Scheme does not mean you can
acquire any lock without deadlock.
Andy
--
http://wingolog.org/
next prev parent reply other threads:[~2012-02-19 9:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-09 19:15 allocation within critical sections Andy Wingo
2012-02-13 10:38 ` Andy Wingo
2012-02-13 15:29 ` Andy Wingo
2012-02-16 21:30 ` Ludovic Courtès
2012-02-16 22:27 ` Andy Wingo
2012-02-17 2:46 ` Mike Gran
2012-02-17 8:16 ` Andy Wingo
2012-02-17 10:32 ` Mike Gran
2012-02-17 15:20 ` Andy Wingo
2012-02-17 22:59 ` Ludovic Courtès
2012-02-19 9:42 ` Andy Wingo [this message]
2012-02-19 20:56 ` Ludovic Courtès
2012-02-19 21:29 ` Andy Wingo
2012-02-24 15:04 ` Andy Wingo
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ty2n17mu.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).