Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: filled in definition of safe publication

...

Anchor
safe publication
safe publication

safe publication: To publish an object safely, both the reference to the object and the \[state of the object\] must be made visible to other threads at the same time. A properly constructed object can be safely published by:

  • Initializing an object reference from a static initializer;
  • Storing a reference to it into a volatile field or AtomicReference;
  • Storing a reference to it into a final field of a properly constructed object; or
  • Storing a reference to it into a field that is properly guarded by a lock.

Definition TBD [Goetz 2006, §3.5 "Safe Publication"].

...