Re: RFR 8151198: VarHandle factory-specific exceptions

2016-04-09 Thread Vitaly Davidovich
The issue with "program order" is it may confuse people, particularly ones that don't know what a compiler fence is, into thinking it implies CPU fences as well (they may not know those either, perhaps). You'd need to define program order anyway for them. IMHO, I'd rather see compiler fence used

Re: RFR 8151198: VarHandle factory-specific exceptions

2016-04-09 Thread Doug Lea
On 04/09/2016 09:03 AM, Vitaly Davidovich wrote: Just to confirm - opaque is also a compiler fence right? C++ relaxed doesn't require compiler fence, but it sounds like opaque does. Would be good to clarify this, unless "program order" is the way you want to do that. "Program order" normally

Re: RFR 8151198: VarHandle factory-specific exceptions

2016-04-09 Thread Vitaly Davidovich
Just to confirm - opaque is also a compiler fence right? C++ relaxed doesn't require compiler fence, but it sounds like opaque does. Would be good to clarify this, unless "program order" is the way you want to do that. On Saturday, April 9, 2016, Doug Lea wrote: > On 04/08/2016 02:39 PM, Hans B

Re: RFR 8151198: VarHandle factory-specific exceptions

2016-04-09 Thread Doug Lea
On 04/08/2016 02:39 PM, Hans Boehm wrote: My prior impression was that Opaque was intended to be similar to a C++ memory_order_relaxed access to a variable that is declared as both atomic and volatile, with the unordered interpretation of C++ "volatile". Yes. This is awkward to spell out in de

Re: RFR 8151198: VarHandle factory-specific exceptions

2016-04-08 Thread Aleksey Shipilev
On 04/08/2016 09:39 PM, Hans Boehm wrote: > I didn't previously have the impression that get/setOpaque was analogous > to just C/C++ volatile. C volatile officially has nothing to do with > threads and does not prevent undefined behavior for data races. It does > not in general guarantee single-c

Re: RFR 8151198: VarHandle factory-specific exceptions

2016-04-08 Thread Paul Sandoz
> On 8 Apr 2016, at 17:59, Martin Buchholz wrote: > > On Fri, Apr 8, 2016 at 7:40 AM, Aleksey Shipilev > wrote: >> On 04/08/2016 03:51 PM, Paul Sandoz wrote: >>> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8151198-VH-factory-exceptions/webrev/ >>>

Re: RFR 8151198: VarHandle factory-specific exceptions

2016-04-08 Thread Martin Buchholz
On Fri, Apr 8, 2016 at 7:40 AM, Aleksey Shipilev wrote: > On 04/08/2016 03:51 PM, Paul Sandoz wrote: >> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8151198-VH-factory-exceptions/webrev/ >> > > I agree with update

Re: RFR 8151198: VarHandle factory-specific exceptions

2016-04-08 Thread Aleksey Shipilev
On 04/08/2016 03:51 PM, Paul Sandoz wrote: > http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8151198-VH-factory-exceptions/webrev/ > I agree with updates. But have more comments on C/C++ @apiNote-s. Would you like t