The title is a bit of a trick question – if the JVM meets all the tests to qualify being called Java then it is portable.  However the website  JavaSpecialists  has a series of brilliant  articles about some of the depths of Java, with a rather interesting article called ‘Law of Cretan Driving’ which looks at the way 64 bit value are handled (such as long) within the JVM.  The article points out that it is not mandatory for the JVM to ensure that the bytes that are used to represent a long can not be manipulated by separate threads at anyone time. That is to say that any 64bit primitive such as a long is not guaranteed to be thread safe.  However problem is that primitive data types are generally considered by developers to be atomically safe – which isn’t necessarily the case. So we can find that a java application which is theoretically portable may actually not port.

Java Standard – http://java.sun.com/docs/books/jvms/second_edition/html/Concepts.doc.html#17876


del.icio.us tags: , ,