[concurrency-interest] jdk9 VarHandle and Fence methods

Vitaly Davidovich vitalyd at gmail.com
Sun Aug 23 13:30:36 EDT 2015


That's likely a store/write barrier for GC (i.e. card mark).

sent from my phone
On Aug 23, 2015 1:17 PM, "thurstonn" <thurston at nomagicsoftware.com> wrote:

> from unsafe.cpp:
>
> UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSwapObject(JNIEnv *env, jobject
> unsafe, jobject obj, jlong offset, jobject e_h, jobject x_h))
>
>   UnsafeWrapper("Unsafe_CompareAndSwapObject");
>
>   oop x = JNIHandles::resolve(x_h);
>
>   oop e = JNIHandles::resolve(e_h);
>
>   oop p = JNIHandles::resolve(obj);
>
>   HeapWord* addr = (HeapWord *)index_oop_from_field_offset_long(p, offset);
>
>   oop res = oopDesc::atomic_compare_exchange_oop(x, addr, e, true);
>
>   jboolean success  = (res == e);
>
>  * if (success)
>
>     update_barrier_set((void*)addr, x);*
>
>   return success;
>
> UNSAFE_END
>
> That's what I was referring to; I  presumed update_barrier_set resulted in
> some sort of store fence
>
>
>
> --
> View this message in context:
> http://jsr166-concurrency.10961.n7.nabble.com/jdk9-VarHandle-and-Fence-methods-tp12666p12688.html
> Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20150823/953f8e47/attachment.html>


More information about the Concurrency-interest mailing list