unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel@gnu.org
Subject: Re: GNU Guile branch, wip-peval-predicates, created. v2.0.5-100-g59c5570
Date: Sat, 14 Apr 2012 17:28:29 -0700	[thread overview]
Message-ID: <87sjg53kk2.fsf@pobox.com> (raw)
In-Reply-To: <87sjg74l2b.fsf@netris.org> (Mark H. Weaver's message of "Fri, 13 Apr 2012 13:07:40 -0400")

Hi,

On Fri 13 Apr 2012 10:07, Mark H Weaver <mhw@netris.org> writes:

> Nonetheless, the vtable checks involve comparisons with a mutable
> top-level variable.  Whenever unknown code is run (e.g. when a top-level
> procedure is called) you must assume the worst: that any top-level
> variable might have been 'set!'.

You probably saw, but wip-cse does effects analysis to prove that the
toplevel hasn't been set! by intervening expressions.

There is of course the question of what optimizations like this may be
made in the presence of concurrently executing threads.  For example, in
wip-cse the following expression folds:

  (if (eq? x y) (eq? x y) #f) => (eq? x y)

This is because there was no toplevel-set! in between the first and
second checks.  The possible side effects of referencing X or Y would
happen on the first check or not at all, so the second expression can
cause no effects.  (If CSE sees a call to an unknown procedure, it's
assumed that it can cause any effect, and thus such a call does not
commute with anything but a "constant" expression.)

But OK, the question here is, what if another thread is concurrently
mutating X and Y?  If this were C++ or Java, the answer would be that
they can still fold, because access to a multithreaded mutable needs to
be synchronized.  I think this is reasonable.  What do you think?

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2012-04-15  0:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1SHjzo-0005oe-8t@vcs.savannah.gnu.org>
2012-04-13 14:22 ` GNU Guile branch, wip-peval-predicates, created. v2.0.5-100-g59c5570 Mark H Weaver
2012-04-13 15:18   ` Noah Lavine
2012-04-13 19:59     ` Ludovic Courtès
2012-04-13 20:36       ` Noah Lavine
2012-04-13 16:28   ` Andy Wingo
2012-04-13 17:07     ` Mark H Weaver
2012-04-15  0:28       ` Andy Wingo [this message]
2012-04-15  7:53         ` David Kastrup
2012-04-15 21:26         ` Ludovic Courtès
2012-04-16  6:36           ` David Kastrup

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=87sjg53kk2.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=mhw@netris.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).