This is an excellent point, and one I must confess I had not thought
of.  I actually think this is a bug beyond simply upgrading to 1.5
since the jvm spec does not guarantee execution order of threads in
queue.  So I'm going to file a bug to, at a minimum, migrate the
synchronized blocks to use one of the concurrent (either backport or
java 1.5) "kind" queues.

Thanks for the input.

-Tom

On 9/18/07, Johan Tordsson <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> In a migration to Java 1.5, one has to consider the changed
> semantics of "synchronized" in the commonly used Sun JVM.
> In Java 1.4, waiting threads are queued up in FIFO order, which is
> typically the behavior expected by the developer.
> This is however changed to LIFO order in Sun's Java 1.5 JVM,
> making the code starvation-prone under high load.
>
> Sun suggest replacing synchronized blocks with one of the
> locking mechanisms found in the java.util.concurrent library.
>
> More details about this:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6316090
>
> A quick count in the Java WS Core 4.0.5 code gives 184 usages of
> "synchronized". Replacing these by a FIFO locking mechanism should require 
> some
> effort from the developers.
>
> Best regards,
>
> Johan Tordsson
>
>
> On Mon, 17 Sep 2007, Tom Howe wrote:
>
> > While looking into the solutions available for supporting database
> > persistence for resources we discovered that the best solution was the
> > Java Persistence API (JPA).  This approach requires the least demands
> > on the service developer while providing a highly performant, standard
> > solution that is acceptable under the apache license.  However, JPA
> > requires java 5 because it is based on annotations.  As a result, we
> > started to consider the costs and benefits of moving the java ws core
> > to Java 5.  This email should outline these costs and benefits and,
> > hopefully, justify moving the java ws core to Java 5.  Let's start
> > with the costs of migrating to Java 5.
> >
> > Cost:
> > - Upgrade to JDK 1.5. A version available for all platforms supported by
> > Globus
> > - Changes to language specification. Developers need to change use of enum
> > as variable name.
> >
> > Benefits:
> > - Allow use of JPA
> > - Annotations and -javaagent may be leveraged by Java WS Core to improve
> > service development usability through bytecode enhancement
> > - Other features useful for cleaner code: Generics,
> > java.util.concurrency, JAXP improvements, static imports, enhanced for
> > loop
> >
> > A more in depth discussion of the costs and benefits is available
> > here: http://www-unix.mcs.anl.gov/~ranantha/java5Upgrade.txt.
> >
> > Finally, since Java 6 has been out for quite a while and Java 7 is in
> > the works, this seems like an appropriate time to upgrade to Java 5.
> > It has been well tested and supported.  It could make developing
> > services for the Java WS-Core a more pleasant experience.
> >
> > Please provide comments, concerns and questions.
> >
> > Thanks,
> > Tom
> >
>
>
> ---------------------------------
>
>   Johan Tordsson
>   Department of Computing Science
>   Umea University
>   SE-901 87 Umea
>   tordsson_at_cs.umu.se
>
>

Reply via email to