Some discussion threads have mentioned about out-of-order execution of Java code, however they do not explictly claim that JVM executes byte codes out-of-order. So I wonder if it is true; and if it is, is there an (official) technical document about the topic?
thanks.
Edit: I understand that CPU executes instructions out-of-order, but I wish to know whether JVM itself executes byte codes out-of-order.
JVMS explains this topic. In general, JVM is free to do some sort of reordering of the bytecode, which may produce unexpected behavior in multithreaded applications.
For single-threaded application and every single thread the reordering does not affect the behavior and program/thread execution is same as you expect in source code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With