Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #10911

Re: reading the JLS (17.4.5)

Date 2011-12-20 12:12 -0800
From Patricia Shanahan <pats@acm.org>
Newsgroups comp.lang.java.programmer
Subject Re: reading the JLS (17.4.5)
References <slrnjerm1c.fvg.avl@gamma.logic.tuwien.ac.at> <jckv1o$v1v$1@dont-email.me> <slrnjf1iug.fvg.avl@gamma.logic.tuwien.ac.at> <jcqlef$5rp$1@dont-email.me>
Message-ID <B5-dnV9Gn_2ncW3TnZ2dnUVZ_h6dnZ2d@earthlink.com> (permalink)

Show all headers | View raw


On 12/20/2011 10:50 AM, markspace wrote:
...
> Patricia had some thoughts on reordering by hardware, but that involved
> synchronization and memory barriers, and I don't recall seeing those
> discussed in the small JLS section in question. I think this JLS section
> applies more generally than a read or write getting moved out of a
> synchronization block. I think it applies absolutely everywhere.

I just wanted to construct one specific case, and picked a fairly
arbitrary combination of operations and events. Producing the sort of
effect I was aiming for does require a happens-before relationship
between two actions in different threads.

I think "happens-before" should be thought of as short for "must appear
to happen before". As the JLS says "It should be noted that the presence
of a happens-before relationship between two actions does not
necessarily imply that they have to take place in that order in an
implementation. If the reordering produces results consistent with a
legal execution, it is not illegal."

Prohibiting a read R from seeing the result of a write W if R "must
appear to happen before" W, but may in fact have happened after W, is
quite reasonable.

Patricia

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

reading the JLS (17.4.5) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-12-18 12:10 +0000
  Re: reading the JLS (17.4.5) markspace <-@.> - 2011-12-18 06:57 -0800
    Re: reading the JLS (17.4.5) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-12-20 17:54 +0000
      Re: reading the JLS (17.4.5) markspace <-@.> - 2011-12-20 10:50 -0800
        Re: reading the JLS (17.4.5) Patricia Shanahan <pats@acm.org> - 2011-12-20 12:12 -0800
          Re: reading the JLS (17.4.5) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-12-21 08:54 +0000
            Re: reading the JLS (17.4.5) Patricia Shanahan <pats@acm.org> - 2011-12-21 10:56 -0800
              Re: reading the JLS (17.4.5) markspace <-@.> - 2011-12-21 12:02 -0800
  Re: reading the JLS (17.4.5) Patricia Shanahan <pats@acm.org> - 2011-12-18 09:21 -0800
    Re: reading the JLS (17.4.5) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-12-20 18:35 +0000
      Re: reading the JLS (17.4.5) Lew <lewbloch@gmail.com> - 2011-12-20 19:08 -0800
        Re: reading the JLS (17.4.5) Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-12-21 08:37 +0000
          Re: reading the JLS (17.4.5) Patricia Shanahan <pats@acm.org> - 2011-12-21 10:46 -0800
          Re: reading the JLS (17.4.5) markspace <-@.> - 2011-12-21 12:09 -0800

csiph-web