Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6281377

Provide Unsafe lazy field set methods

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • core-libs

      Doug Lea writes:

      "The request is to add three methods, whose primary use
      is to support lazySet, but are also needed to
      correctly and efficiently handle barrier-less volatile
      writes. For example, setting the parkBlocker in support
      of Mandy's stuff. (I can add more explanation and
      implementation notes if they would be useful for CCC.)



            /**
             * Version of {@link #putObjectVolatile(Object, long, Object)}
             * that does not guarantee immediate visibility of the store to
             * other threads. This method is generally only useful if the
             * underlying field is a Java volatile (or if an array cell, one
             * that is otherwise only accessed using volatile accesses).
             */
            public native void putOrderedObject(Object o, long offset,
      Object x);

            /** Ordered/Lazy version of {@link #putIntVolatile(Object, long,
      int)} */
            public native void putOrderedInt(Object o, long offset, int x);

            /** Ordered/Lazy version of {@link #putLongVolatile(Object, long,
      long)} */
            public native void putOrderedLong(Object o, long offset, long x);
      "

      ###@###.### 2005-06-07 07:06:32 GMT

            martin Martin Buchholz
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: