unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: guile-devel <guile-devel@gnu.org>
Subject: Re: catch, throw, prompt, control, fluids, garbage collection
Date: Mon, 15 Feb 2010 23:07:40 +0100	[thread overview]
Message-ID: <m3tyti40gj.fsf@pobox.com> (raw)
In-Reply-To: <m3fx54ateh.fsf@pobox.com> (Andy Wingo's message of "Sun, 14 Feb 2010 13:33:42 +0100")

Hi,

A brief note.

On Sun 14 Feb 2010 13:33, Andy Wingo <wingo@pobox.com> writes:

> I am currently shaving a yak.

I wrote more about the yak:
http://wingolog.org/archives/2010/02/14/sidelong-glimpses

In it I concluded,

    I need an efficient with-fluids, some pieces of prompt and abort,
    and to add that all to the bootstrap language of Guile, and I have
    it.

So, regarding fluids:

> The problem: Well, you might want to set some exception handlers, and
> then spawn a bunch of threads all with those handlers. But if a
> pre-unwind handler throws an exception, that exception shouldn't be
> handled by itself, or you get an infinite loop. Basically you need a bit
> to say whether a given handler is running in a given thread or not -- a
> fluid.

It should probably be thread-local, but it doesn't need to be
per-exception-handler -- a thread-local weak hash or even a list would
be fine.

At the same time, I came to the conclusion that Guile's current
implementation of fluids is best. With Emacs we really want shallow
binding, and we can store a pointer to the fluid vector (dynamic state)
in the VM's data itself, so accessing fluids can be quite fast.

It will need to be documented that currently fluids can't be collected,
and if users need collectable fluids, they should use an indirection
(like a fluid containing a weak key hash table).

See also:
    http://www.gnu.org/s/emacs/manual/html_node/elisp/Impl-of-Scope.html
and
    http://www.franz.com/support/documentation/8.0/doc/multiprocessing.htm#wide-binding-1.

I'm close to having the problem solved, but it will take another couple
weeks. Also I haven't gotten to NEWS this evening. Sorry!

Ciao,

Andy
-- 
http://wingolog.org/




  parent reply	other threads:[~2010-02-15 22:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-14 12:33 catch, throw, prompt, control, fluids, garbage collection Andy Wingo
2010-02-14 14:32 ` Fluids Ludovic Courtès
2010-02-14 15:50   ` Fluids Andy Wingo
2010-02-14 19:09     ` Fluids Ken Raeburn
2010-03-02 23:52   ` Fluids Ludovic Courtès
2010-03-03 12:29     ` Fluids Andy Wingo
2010-03-03 13:09       ` Fluids Ludovic Courtès
2010-03-05 17:24       ` Fluids Ludovic Courtès
2010-02-14 14:45 ` Plan for the next release Ludovic Courtès
2010-02-14 15:54   ` Andy Wingo
2010-02-15 22:07 ` Andy Wingo [this message]
2010-02-18 22:35   ` catch, throw, prompt, control, fluids, garbage collection Andy Wingo
2010-02-25  0:00     ` Andy Wingo
2010-02-26 12:27       ` Andy Wingo
2010-02-28 22:16         ` Neil Jerram
2010-07-17 10:15           ` 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=m3tyti40gj.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@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).