VarHandles & LMAX Disruptor

Vitaly Davidovich vitalyd at gmail.com
Tue Aug 4 19:54:15 UTC 2015


>
> A "natural" access mode (respecting underlying variable declaration) is
> useful
> not because it cannot be expressed differently, but because it is safer to
> use.
> Safer because less surprising and easier to reason about.


I don't see how it's safer to use as it hampers readability.  With ordering
semantics, it's very important to see this at the callsite and not some
distance away.

On Tue, Aug 4, 2015 at 3:20 PM, John Rose <john.r.rose at oracle.com> wrote:

> On Jul 28, 2015, at 3:01 PM, Vitaly Davidovich <vitalyd at gmail.com> wrote:
>
>
> Is that in scope though given that VarHandles are really meant to replace
> Unsafe usage, and I don't see how Unsafe supports that "naked"/default
> aspect today.
>
>
> To be fair, Unsafe doesn't support any form of access that is
> user-friendly.
>
> VHs add lots of usability stuff that goes beyond Unsafe, but along a new
> vector.
>
> A "natural" access mode (respecting underlying variable declaration) is
> useful
> not because it cannot be expressed differently, but because it is safer to
> use.
> Safer because less surprising and easier to reason about.
>
> — John
>


More information about the valhalla-dev mailing list