[concurrency-interest] Java 6 support in backport-concurrent

Greg Luck gluck at gregluck.com
Tue Aug 14 04:52:29 EDT 2007


Holger

Thanks for clarifying that.

  My user base is centered around Java 1.5 and slowly
moving to Java 6. Java 3 usage is very low with still a significant  
number on 1.4.

The best answer for me is for backport-concurrent to support Java 6.

If I cannot get assurances that your patch will be applied and  
released in next little while, then the
next best answer is to drop backport-concurrent in the next version  
of ehcache. 1.4 users can continue
to use the backport-concurrent version until they upgrade to Java 5.

I would be great if we can get a position on whether Java 6 will be  
supported.


On 14/08/2007, at 4:52 PM, Holger Hoffstätte wrote:

> David Holmes wrote:
>> Greg,
>>
>> This error doesn't make sense.
>
> It sure does!
>
>> Caused by: java.lang.VerifyError: class
>>  edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger
>>  overrides final method lazySet.(I)V
>>
>> The backport AtomicInteger class doesn't override lazySet, it  
>> defines it. It
>> also has no superclass other than Object to be verified against.
>>
>> It's almost as if the verifier thinks the backport version of  
>> AtomicInteger
>> extends the j.u.c version.
>
> There are several backport "flavors" and in the JDK5 version the  
> backport
> classes indeed extend some native classes. In JDK6 some methods in
> AbstractOwnableQueuedSynchronizer were made final (among them  
> lazySet()),
> so the "half-native" JDK5 backport does not load anymore on JDK6.
>
> I sent the attached patch to Dawid in March and he wanted to  
> incorporate
> it to make a JDK6 flavored backport, but so far it seems that has not
> happened (/nudge). Would be really nice to have, I just started to use
> EHCache as well..
>
> Anybody who needs a Java6 backport lib can just apply the patch to the
> backport 3.0 source or get a prebuilt bundle here:
> http://hoho.dyndns.org/~holger/dist/backport-util-concurrent-3.0- 
> jdk6.zip
>
> Holger
> Index: C:/home/holger/Projects/h2oWorkspace/backport-util- 
> concurrent-jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/ 
> helpers/AbstractOwnableQueuedSynchronizer.java
> ===================================================================
> --- C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/helpers/ 
> AbstractOwnableQueuedSynchronizer.java	(revision 3596)
> +++ C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/helpers/ 
> AbstractOwnableQueuedSynchronizer.java	(working copy)
> @@ -31,29 +31,4 @@
>       */
>      protected AbstractOwnableQueuedSynchronizer() { }
>
> -    /**
> -     * The current owner of exclusive mode synchronization.
> -     */
> -    private transient Thread exclusiveOwnerThread;
> -
> -    /**
> -     * Sets the thread that currently owns exclusive access. A
> -     * <tt>null</tt> argument indicates that no thread owns access.
> -     * This method does not otherwise impose any synchronization or
> -     * <tt>volatile</tt> field accesses.
> -     */
> -    protected final void setExclusiveOwnerThread(Thread t) {
> -        exclusiveOwnerThread = t;
> -    }
> -
> -    /**
> -     * Returns the thread last set by
> -     * <tt>setExclusiveOwnerThread</tt>, or <tt>null</tt> if never
> -     * set.  This method does not otherwise impose any  
> synchronization
> -     * or <tt>volatile</tt> field accesses.
> -     * @return the owner thread
> -     */
> -    protected final Thread getExclusiveOwnerThread() {
> -        return exclusiveOwnerThread;
> -    }
>  }
> Index: C:/home/holger/Projects/h2oWorkspace/backport-util- 
> concurrent-jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/ 
> atomic/AtomicIntegerArray.java
> ===================================================================
> --- C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicIntegerArray.java	(revision 3596)
> +++ C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicIntegerArray.java	(working copy)
> @@ -39,14 +39,4 @@
>          super(array);
>      }
>
> -    /**
> -     * Eventually sets the element at position {@code i} to the  
> given value.
> -     *
> -     * @param i the index
> -     * @param newValue the new value
> -     * @since 1.6
> -     */
> -    public final void lazySet(int i, int newValue) {
> -        super.set(i, newValue);
> -    }
>  }
> Index: C:/home/holger/Projects/h2oWorkspace/backport-util- 
> concurrent-jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/ 
> atomic/AtomicInteger.java
> ===================================================================
> --- C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicInteger.java	(revision 3596)
> +++ C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicInteger.java	(working copy)
> @@ -40,13 +40,4 @@
>          super();
>      }
>
> -    /**
> -     * Eventually sets to the given value.
> -     *
> -     * @param newValue the new value
> -     * @since 1.6
> -     */
> -    public final void lazySet(int newValue) {
> -        super.set(newValue);
> -    }
>  }
> Index: C:/home/holger/Projects/h2oWorkspace/backport-util- 
> concurrent-jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/ 
> atomic/AtomicReferenceArray.java
> ===================================================================
> --- C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicReferenceArray.java	(revision 3596)
> +++ C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicReferenceArray.java	(working copy)
> @@ -38,14 +38,4 @@
>          super(array);
>      }
>
> -    /**
> -     * Eventually sets the element at position {@code i} to the  
> given value.
> -     *
> -     * @param i the index
> -     * @param newValue the new value
> -     * @since 1.6
> -     */
> -    public final void lazySet(int i, Object newValue) {
> -        super.set(i, newValue);
> -    }
>  }
> Index: C:/home/holger/Projects/h2oWorkspace/backport-util- 
> concurrent-jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/ 
> atomic/AtomicLongArray.java
> ===================================================================
> --- C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicLongArray.java	(revision 3596)
> +++ C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicLongArray.java	(working copy)
> @@ -38,14 +38,4 @@
>          super(array);
>      }
>
> -    /**
> -     * Eventually sets the element at position {@code i} to the  
> given value.
> -     *
> -     * @param i the index
> -     * @param newValue the new value
> -     * @since 1.6
> -     */
> -    public final void lazySet(int i, long newValue) {
> -        super.set(i, newValue);
> -    }
>  }
> Index: C:/home/holger/Projects/h2oWorkspace/backport-util- 
> concurrent-jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/ 
> atomic/AtomicReference.java
> ===================================================================
> --- C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicReference.java	(revision 3596)
> +++ C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicReference.java	(working copy)
> @@ -34,13 +34,4 @@
>          super();
>      }
>
> -    /**
> -     * Eventually sets to the given value.
> -     *
> -     * @param newValue the new value
> -     * @since 1.6
> -     */
> -    public final void lazySet(Object newValue) {
> -        super.set(newValue);
> -    }
>  }
> Index: C:/home/holger/Projects/h2oWorkspace/backport-util- 
> concurrent-jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/ 
> atomic/AtomicBoolean.java
> ===================================================================
> --- C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicBoolean.java	(revision 3596)
> +++ C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicBoolean.java	(working copy)
> @@ -37,13 +37,5 @@
>      public AtomicBoolean() {
>          super();
>      }
> -    /**
> -     * Eventually sets to the given value.
> -     *
> -     * @param newValue the new value
> -     * @since 1.6
> -     */
> -    public final void lazySet(boolean newValue) {
> -        super.set(newValue);
> -    }
> +
>  }
> Index: C:/home/holger/Projects/h2oWorkspace/backport-util- 
> concurrent-jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/ 
> atomic/AtomicLong.java
> ===================================================================
> --- C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicLong.java	(revision 3596)
> +++ C:/home/holger/Projects/h2oWorkspace/backport-util-concurrent- 
> jdk6/src/edu/emory/mathcs/backport/java/util/concurrent/atomic/ 
> AtomicLong.java	(working copy)
> @@ -40,13 +40,4 @@
>          super();
>      }
>
> -    /**
> -     * Eventually sets to the given value.
> -     *
> -     * @param newValue the new value
> -     * @since 1.6
> -     */
> -    public final void lazySet(long newValue) {
> -        super.set(newValue);
> -    }
>  }

Regards

Greg Luck

web: http://gregluck.com
skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622



-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20070814/c248bc1d/attachment-0001.html 


More information about the Concurrency-interest mailing list