<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    yes, I got you, and my clumsy question really should have read "upon
    what condition will they drain on their own"<br>
    <br>
    Like, N tics? Coherence traffic ceased? Hyperthreaded sibling does
    something?<br>
    <br>
    Alex<br>
    <br>
    <div class="moz-cite-prefix">On 31/12/2014 16:36, Vitaly Davidovich
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAHjP37G7UMZOLq74Pcp51k5752REsS07t8g22A1OZLN7Pzbd4Q@mail.gmail.com"
      type="cite">
      <p dir="ltr">Your previous reply talked about performing a lazy
        write and then possibly having it stall indefinitely (or until
        preemption, as you say) because nobody forces the buffer to
        drain.  I'm saying if the write actually occurs, it'll drain on
        its own.</p>
      <p dir="ltr">Sent from my phone</p>
      <div class="gmail_quote">On Dec 31, 2014 11:31 AM, "Oleksandr
        Otenko" <<a moz-do-not-send="true"
          href="mailto:oleksandr.otenko@oracle.com">oleksandr.otenko@oracle.com</a>>
        wrote:<br type="attribution">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000"> Yes, but do they drain
            if no one writes anything?<br>
            <br>
            Alex<br>
            <br>
            <div>On 31/12/2014 15:18, Vitaly Davidovich wrote:<br>
            </div>
            <blockquote type="cite">
              <p dir="ltr">Write buffers don't *need* to be drained,
                they drain automatically anyway.  At least that's the
                case for intel.  So the issue here is more like what Gil
                said - compiler can reorder the code causing a deadlock.</p>
              <p dir="ltr">Sent from my phone</p>
              <div class="gmail_quote">On Dec 31, 2014 9:45 AM,
                "Oleksandr Otenko" <<a moz-do-not-send="true"
                  href="mailto:oleksandr.otenko@oracle.com"
                  target="_blank">oleksandr.otenko@oracle.com</a>>
                wrote:<br type="attribution">
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div bgcolor="#FFFFFF" text="#000000"> Not sure why
                    you say (3). Since lazySet is not part of JMM, I am
                    only assuming it is pretty much like an ordered
                    store on x86.<br>
                    <br>
                    In the presence of write buffers the loop may spin
                    indefinitely, yet the lazy-stored write won't become
                    visible to the pong thread - there'd be nothing to
                    cause the buffers of the ping thread to flush. So
                    ping effectively will appear to perform all the
                    loads of the indefinite loop ahead of the store.<br>
                    <br>
                    In reality the only event that would cause the write
                    buffers to flush, is the thread preemption.<br>
                    <br>
                    <br>
                    Alex<br>
                    <br>
                    <br>
                    <div>On 31/12/2014 07:20, Nitsan Wakart wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div
                        style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica
                        Neue,Helvetica,Arial,Lucida
                        Grande,sans-serif;font-size:10px"><font size="3">Re-read

                          the Shipilev "JMM Pragmatics" reference again
                          last night, and discussed with Gil. I think
                          that cup of coffee was nowhere near enough
                          :-). In particular:<br>
                        </font>
                        <div><font size="3">"If IUC this means stores
                            and volatile loads are conservatively not
                            reordered" is FALSE because the premise
                            "IUC" is false. I did not understand
                            correctly which leads me to amend my
                            comment:</font></div>
                        <div><font size="3"><span>1. There's technically
                              nothing to stop reordering between the
                              store and load.</span><br>
                          </font></div>
                        <div><font size="3"><span>> 
                              theLong.lazySet(1L);</span><br>
                            <span>>  Object o = theRef.get();</span><br>
                          </font></div>
                        <div><font size="3">2. <span>There's technically
                              nothing to stop reordering between the
                              store and load.</span></font></div>
                        <div><font size="3"><span>>  long l =
                              theLong.get() + 1; // LOADLOAD</span><br>
                            <span>>  theLong.lazySet(l); //STORESTORE</span><br>
                            <span>>  Object o = theRef.get(); //
                              LOADLOAD</span><br>
                          </font></div>
                        <div dir="ltr"><font size="3">3. I still think
                            the while loop presents a different case to
                            normal flow. So for now I still hold that
                            the lazySet cannot be moved after the while
                            loop.</font></div>
                        <div><font size="3"><br>
                          </font></div>
                        <div dir="ltr"><font size="3">My sincere
                            apologies for the confusion.</font></div>
                        <div dir="ltr"><font size="3">Happy holidays to
                            all.</font></div>
                      </div>
                      <br>
                      <fieldset></fieldset>
                      <br>
                      <pre>_______________________________________________
Concurrency-interest mailing list
<a moz-do-not-send="true" href="mailto:Concurrency-interest@cs.oswego.edu" target="_blank">Concurrency-interest@cs.oswego.edu</a>
<a moz-do-not-send="true" href="http://cs.oswego.edu/mailman/listinfo/concurrency-interest" target="_blank">http://cs.oswego.edu/mailman/listinfo/concurrency-interest</a>
</pre>
                    </blockquote>
                    <br>
                  </div>
                </blockquote>
              </div>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>