Concurrency

  • Concurrent access to shared data requires synchronization mechanisms!
  • Synchronization = Serialization in Execution
  • Synchronisation can be done by using Locks
  • Synchronise only critical sections
  • don’t mix multiple types of locks (synchronized method, synchronized block) Otherwise they are not mutually exclusive
  • if locking multiple resources, always lock in the same order