From: Andy Wingo <wingo@pobox.com>
To: "Neil Jerram" <neiljerram@googlemail.com>
Cc: "Ludovic Courtès" <ludo@gnu.org>, guile-devel@gnu.org
Subject: Re: array handles and non-local exits
Date: Sat, 04 Jul 2009 21:28:24 +0200 [thread overview]
Message-ID: <m3skhcdz8n.fsf@pobox.com> (raw)
In-Reply-To: <49dd78620809180217p21c36802me305270af14a6f95@mail.gmail.com> (Neil Jerram's message of "Thu, 18 Sep 2008 10:17:45 +0100")
Hey folks :)
On Thu 18 Sep 2008 11:17, "Neil Jerram" <neiljerram@googlemail.com> writes:
> In my view, this part is still useful:
>
> "You must take care to always unreserve an array after reserving it,
> also in the presence of non-local exits. To simplify this, reserving
> and unreserving work like a dynwind context (see Dynamic Wind): a call
> to scm_array_get_handle can be thought of as beginning a dynwind
> context and scm_array_handle_release as ending it. When a non-local
> exit happens between these two calls, the array is implicitely
> unreserved.
>
> That is, you need to properly pair reserving and unreserving in your
> code, but you don't need to worry about non-local exits."
I'm hacking on this code right now, and have come to think that
scm_array_handle_release is superfluous. It shouldn't protect against
concurrent modification of the data, as that should be done with
user-implemented mutexen. It obviously doesn't do anything now -- and
really, it doesn't have anything to do. I can't think of a /supported/
modification of an array that will leave a pointer to the elements
invalid -- i.e. we have no truncation ops that I know of.
The pointer will always be valid as long as we have a reference to the
array itself (which we do, on the stack, in the scm_t_array_handle).
Andy
--
http://wingolog.org/
next prev parent reply other threads:[~2009-07-04 19:28 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-15 20:17 array handles and non-local exits Neil Jerram
2008-09-16 7:56 ` Ludovic Courtès
2008-09-17 19:32 ` Neil Jerram
2008-09-18 8:15 ` Ludovic Courtès
2008-09-18 9:17 ` Neil Jerram
2008-09-18 13:44 ` Ludovic Courtès
2009-06-30 22:59 ` Neil Jerram
2009-07-01 8:37 ` Ludovic Courtès
2009-07-01 22:04 ` Neil Jerram
2009-07-01 22:36 ` Ludovic Courtès
2009-07-02 23:33 ` Neil Jerram
2009-07-03 23:38 ` Neil Jerram
2009-07-04 19:28 ` Andy Wingo [this message]
2009-07-05 11:14 ` Ludovic Courtès
2009-07-06 14:09 ` Andy Wingo
2009-07-06 20:30 ` Ludovic Courtès
2009-07-09 19:19 ` Andy Wingo
2009-07-09 21:08 ` Ludovic Courtès
2009-07-10 10:27 ` Andy Wingo
2009-07-10 12:05 ` Ludovic Courtès
2009-07-19 20:04 ` Neil Jerram
2009-07-20 9:20 ` Ludovic Courtès
2009-07-23 21:20 ` 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=m3skhcdz8n.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=neiljerram@googlemail.com \
/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).