From: "Richard W.M. Jones" <rich@annexia.org>
To: Gabriel Scherer <gabriel.scherer@gmail.com>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Are refs volatile?
Date: Wed, 4 Nov 2015 15:23:39 +0000 [thread overview]
Message-ID: <20151104152339.GP3006@annexia.org> (raw)
In-Reply-To: <CAPFanBFuCxnKuZv_ioBPeP2x445-nJXek-f4fBw-W9Ge0GtKAQ@mail.gmail.com>
On Wed, Nov 04, 2015 at 04:08:48PM +0100, Gabriel Scherer wrote:
> I find the question hard to understand, so I may have missed a subtlety in
> the code you have shown.
It's very possible I don't know what I'm talking about, but
this is my analysis:
> > List.iter (
> > fun task ->
> > if not !quit then task ();
> > ) tasks;
Suppose that the optimizer can see the contents of `task', and see
that it cannot update the quit variable. In that case, could it
assume that quit is a constant, and hoist the test outside the loop?
ie. transforming the code to:
if not !quit then (
List.iter (
fun task ->
task ();
) tasks
)
Rich.
--
Richard Jones
Red Hat
next prev parent reply other threads:[~2015-11-04 15:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 12:43 Richard W.M. Jones
2015-11-04 13:18 ` Gerd Stolpmann
2015-11-04 15:08 ` Gabriel Scherer
2015-11-04 15:23 ` Richard W.M. Jones [this message]
2015-11-04 15:56 ` Pierre Chambart
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=20151104152339.GP3006@annexia.org \
--to=rich@annexia.org \
--cc=caml-list@inria.fr \
--cc=gabriel.scherer@gmail.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