Re: Are there real use cases with the Java access modes?
Gregg Wonderly via Concurrency-interest <[email protected]> Fri, 23 Jul 2021 15:02:49 -0500
| Newsgroups | gmane.comp.java.jsr.166-concurrency |
|---|---|
| Message-ID | <[email protected]> |
--===============7632474243220556970== Content-Type: multipart/alternative; boundary="Apple-Mail=_57584994-4F8A-450B-BB12-C7F2C104969D" --Apple-Mail=_57584994-4F8A-450B-BB12-C7F2C104969D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 23, 2021, at 2:31 PM, Alex Otenko via Concurrency-interest = <[email protected]> wrote: > On Fri, 23 Jul 2021, 16:24 Gregg Wonderly, <[email protected] = <mailto:[email protected]>> wrote: >=20 >=20 > > On Jul 23, 2021, at 4:14 AM, Andrew Dinn via Concurrency-interest = <[email protected] = <mailto:[email protected]>> wrote: > >=20 > > On 23/07/2021 04:36, Gregg Wonderly via Concurrency-interest > >=20 > >> Truly, it takes pretty extreme expertise and experience to truly > >> understand how to [use Java to] do concurrent programming. > >=20 > > Let's just note that if you take out the bracketed phrase that = statement still remains true. >=20 > I added that phrase because my experience with concurrency inside of = Java programs is the largest exposure I have. But that is dated = compared to my use of multi-threaded application in C/C++ that I=E2=80=99v= e recently been involved in. In those cases, there is no worry about = non-volatile hoisting doesn=E2=80=99t occur at all. =20 >=20 > I am sorry to burst your bubble... >=20 > http://eel.is/c++draft/intro.progress = <http://eel.is/c++draft/intro.progress> >=20 > Quote: > The implementation may assume that any thread will eventually do one = of the following: > (1.1) <http://eel.is/c++draft/intro.progress#1.1>terminate, > (1.2) <http://eel.is/c++draft/intro.progress#1.2>make a call to a = library I/O function, > (1.3) <http://eel.is/c++draft/intro.progress#1.3>perform an access = through a volatile glvalue, or > (1.4) <http://eel.is/c++draft/intro.progress#1.4>perform a = synchronization operation or an atomic operation. = <http://eel.is/c++draft/intro.progress#1.sentence-1> > [Note 1 <http://eel.is/c++draft/intro.progress#note-1>: This is = intended to allow compiler transformations such as removal of empty = loops, even when termination cannot be proven. = <http://eel.is/c++draft/intro.progress#1.sentence-2> =E2=80=94 end note] Empty loop optimizations have been around for a long time. I suppose = you may be trying to tell me that there=E2=80=99s all kinds of places in = all kinds of ways that your code may disappear or executed differently = than you expect? Gregg Wonderly --Apple-Mail=_57584994-4F8A-450B-BB12-C7F2C104969D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br = class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D"">On Jul 23, 2021, at 2:31 PM, Alex Otenko via = Concurrency-interest <<a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>> wrote:</div><div = class=3D""><div dir=3D"auto" style=3D"caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = text-decoration: none;" class=3D""><div class=3D""><div = class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, 23 = Jul 2021, 16:24 Gregg Wonderly, <<a href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>> wrote:<br class=3D""></div><blockquote = class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; = border-left-width: 1px; border-left-style: solid; border-left-color: = rgb(204, 204, 204); padding-left: 1ex;"><br class=3D""><br class=3D"">>= On Jul 23, 2021, at 4:14 AM, Andrew Dinn via Concurrency-interest = <<a href=3D"mailto:[email protected]" = target=3D"_blank" rel=3D"noreferrer" = class=3D"">[email protected]</a>> wrote:<br = class=3D"">><span class=3D"Apple-converted-space"> </span><br = class=3D"">> On 23/07/2021 04:36, Gregg Wonderly via = Concurrency-interest<br class=3D"">><span = class=3D"Apple-converted-space"> </span><br class=3D"">>> = Truly, it takes pretty extreme expertise and experience to truly<br = class=3D"">>> understand how to [use Java to] do concurrent = programming.<br class=3D"">><span = class=3D"Apple-converted-space"> </span><br class=3D"">> Let's = just note that if you take out the bracketed phrase that statement still = remains true.<br class=3D""><br class=3D"">I added that phrase because = my experience with concurrency inside of Java programs is the largest = exposure I have. But that is dated compared to my use of = multi-threaded application in C/C++ that I=E2=80=99ve recently been = involved in. In those cases, there is no worry about non-volatile = hoisting doesn=E2=80=99t occur at all. <span = class=3D"Apple-converted-space"> </span></blockquote></div></div><div= dir=3D"auto" class=3D""><br class=3D""></div><div dir=3D"auto" = class=3D"">I am sorry to burst your bubble...</div><div dir=3D"auto" = class=3D""><br class=3D""></div><div dir=3D"auto" class=3D""><a = href=3D"http://eel.is/c++draft/intro.progress" = class=3D"">http://eel.is/c++draft/intro.progress</a><br = class=3D""></div><div dir=3D"auto" class=3D""><br class=3D""></div><div = dir=3D"auto" class=3D"">Quote:</div><div dir=3D"auto" class=3D""><div = dir=3D"auto" style=3D"background-image: inherit; background-size: = inherit; background-origin: inherit; background-clip: inherit; display: = inline; font-family: "times new roman"; text-align: justify; = background-position: inherit inherit; background-repeat: inherit = inherit;" class=3D"">The implementation may assume that any thread will = eventually do one of the following:<ul style=3D"list-style-type: none; = padding-left: 9mm; margin-top: 0px; margin-bottom: 0px;" class=3D""><li = style=3D"margin-top: 3pt; margin-bottom: 3pt;" class=3D""><div = style=3D"background-image: inherit; background-size: inherit; = background-origin: inherit; background-clip: inherit; = background-position: inherit inherit; background-repeat: inherit = inherit;" class=3D""><a href=3D"http://eel.is/c++draft/intro.progress#1.1"= style=3D"text-decoration-line: none; width: 15mm; font-size: 7pt; = text-align: right;" class=3D"">(1.1)</a></div>terminate,</li><li = style=3D"margin-top: 3pt; margin-bottom: 3pt;" class=3D""><div = style=3D"background-image: inherit; background-size: inherit; = background-origin: inherit; background-clip: inherit; = background-position: inherit inherit; background-repeat: inherit = inherit;" class=3D""><a href=3D"http://eel.is/c++draft/intro.progress#1.2"= style=3D"text-decoration-line: none; width: 15mm; font-size: 7pt; = text-align: right;" class=3D"">(1.2)</a></div>make a call to a library = I/O function,</li><li style=3D"margin-top: 3pt; margin-bottom: 3pt;" = class=3D""><div style=3D"background-image: inherit; background-size: = inherit; background-origin: inherit; background-clip: inherit; = background-position: inherit inherit; background-repeat: inherit = inherit;" class=3D""><a href=3D"http://eel.is/c++draft/intro.progress#1.3"= style=3D"text-decoration-line: none; width: 15mm; font-size: 7pt; = text-align: right;" class=3D"">(1.3)</a></div>perform an access through = a volatile glvalue, or</li><li style=3D"margin-top: 3pt; margin-bottom: = 3pt;" class=3D""><div style=3D"background-image: inherit; = background-size: inherit; background-origin: inherit; background-clip: = inherit; background-position: inherit inherit; background-repeat: = inherit inherit;" class=3D""><a = href=3D"http://eel.is/c++draft/intro.progress#1.4" = style=3D"text-decoration-line: none; width: 15mm; font-size: 7pt; = text-align: right;" class=3D"">(1.4)</a></div>perform a synchronization = operation or an atomic operation<a = href=3D"http://eel.is/c++draft/intro.progress#1.sentence-1" = style=3D"text-decoration-line: none;" = class=3D"">.</a></li></ul></div><span style=3D"font-family: "times = new roman"; font-size: 16px; text-align: justify;" = class=3D""></span><div dir=3D"auto" style=3D"background-image: inherit; = background-size: inherit; background-origin: inherit; background-clip: = inherit; margin-top: 5pt; margin-bottom: 5pt; font-size: 11pt; = font-family: "times new roman"; text-align: justify; = background-position: inherit inherit; background-repeat: inherit = inherit;" class=3D""><div style=3D"background-image: inherit; = background-size: inherit; background-origin: inherit; background-clip: = inherit; margin-top: 3pt; margin-bottom: 3pt; background-position: = inherit inherit; background-repeat: inherit inherit;" class=3D"">[<i = class=3D"">Note <a = href=3D"http://eel.is/c++draft/intro.progress#note-1" = style=3D"text-decoration-line: none;" class=3D"">1</a></i>: <div = style=3D"background-image: inherit; background-size: inherit; = background-origin: inherit; background-clip: inherit; display: inline; = background-position: inherit inherit; background-repeat: inherit = inherit;" class=3D"">This is intended to allow compiler transformations = such as<span class=3D"Apple-converted-space"> </span><b = class=3D"">removal of empty loops, even when termination cannot be = proven<a href=3D"http://eel.is/c++draft/intro.progress#1.sentence-2" = style=3D"text-decoration-line: none;" class=3D"">.</a></b></div><b = class=3D""> </b>=E2=80=94 <i class=3D"">end = note</i>]</div></div></div></div></div></blockquote><div><br = class=3D""></div><div>Empty loop optimizations have been around for a = long time. I suppose you may be trying to tell me that there=E2=80=99= s all kinds of places in all kinds of ways that your code may disappear = or executed differently than you expect?</div><div><br = class=3D""></div><div>Gregg Wonderly</div></div><br = class=3D""></body></html>= --Apple-Mail=_57584994-4F8A-450B-BB12-C7F2C104969D-- --===============7632474243220556970== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KQ29uY3VycmVu Y3ktaW50ZXJlc3QgbWFpbGluZyBsaXN0CkNvbmN1cnJlbmN5LWludGVyZXN0QGNzLm9zd2Vnby5l ZHUKaHR0cDovL2NzLm9zd2Vnby5lZHUvbWFpbG1hbi9saXN0aW5mby9jb25jdXJyZW5jeS1pbnRl cmVzdAo= --===============7632474243220556970==--