Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by NavBot

To avoid data corruption in multithreaded Java programs, shared data must be protected from concurrent modifications and accesses, as detailed in CON30CON00-J. Synchronize access to shared mutable variables. This can be done at the object level by using synchronized blocks (coarse-grained locking), as a result locking out other threads from interfering. If synchronization is used judiciously, deadlocks do not usually crop up (See CON00-J. Do not invoke a superclass method or constructor from a synchronized region in the subclass).

...