Java 5. Atomic Reference


Notable Java 5 features:

  • Generics!
  • AtomicReference was introduced to leverage i486 CMPXCHG instruction — now we can stop using synchronized, but it’s hard to do because it metastasized into the whole codebase
  • varargs
  • enums
  • auto boxing/unboxing
  • foreach loop