RFR 8158039 VarHandle float/double field/array access should support CAS/set/add atomics
martinrb at google.com
Thu Jun 2 17:56:12 UTC 2016
I don't see any way that AtomicDouble could get into trouble with
floating point weirdness.
Users cannot provide arbitrary long bit patterns; they have to provide
an actual java double.
It encapsulates the existing advice of transforming double to long.
I suppose someone could do
and fail because we're storing a DIFFERENT NaN, but we have little sympathy.
It's possible to collapse all the NaNs into the One True NaN on input,
but I don't recommend it.
On Thu, Jun 2, 2016 at 8:29 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>> On 2 Jun 2016, at 14:41, Martin Buchholz <martinrb at google.com> wrote:
>> You can find an AtomicDouble in jsr166 CVS
>> and in guava
>> I'm still in favor of putting it in openjdk.
> Thanks, that is helpful.
> What pushed me over the edge in favour was the support for sub-word CAS. The float/double types are lonely and want to join the club as fully signed up members :-)
> I will produce another patch with fixes and better docs.
More information about the jdk9-dev