harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6137) [drlvm][concurrent] AtomicLong compare and swap returning wrong indicator
Date Fri, 03 Apr 2009 01:09:12 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695202#action_12695202
] 

Nathan Beyer commented on HARMONY-6137:
---------------------------------------

On Ubuntu 8.10 x86_64, I'm not seeing the incorrect output. I'm going to test this out on
an x86 machine with the same OS.

The code for this has all been inlined into the header as inline assembly, for linux x86,
linux x86_64, win 32 and win 64 - it's rather messy.

> [drlvm][concurrent] AtomicLong compare and swap returning wrong indicator
> -------------------------------------------------------------------------
>
>                 Key: HARMONY-6137
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6137
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux, r761319
>            Reporter: Tim Ellison
>
> Consider the following code that exercises AtomLong compare and swap operations:
> 		AtomicLong atomLong = new AtomicLong(1);
> 		System.out.println(atomLong.get());
> 		System.out.println("CAS 1,-4 = " + atomLong.compareAndSet(1, -4));
> 		System.out.println(atomLong.get());
> 		System.out.println("CAS -5,1 = " + atomLong.compareAndSet(-5, 1));
> 		System.out.println(atomLong.get());
> I expect it to print out:
>    1
>    CAS 1,-4 = true
>    -4
>    CAS -5,1 = false
>    -4
> Since the comparison of --4 and -5 fails.
> However when running that code on harmony r761319 I see
>    1
>    CAS 1,-4 = true
>    -4
>    CAS -5,1 = true
>    -4
> i.e. the swap is not done, but the method returned true as though it had done the swap.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message