Multi-threaded programming is hard

Lecture from 并发:如人饮水,冷暖自知

Here is the summary:

  • Multi-thread is hard because of
    • memory model
    • memory access can be reordered by
      • compiler
      • JVM
      • CPU
  • The problem is shared, mutable data
    • shared, mutable data => Functional programming
    • shared, mutable data => Message Passing: Actors
    • shared, mutable => Software Transactional Memory
  • Concurreny is hard => Threads and Locks are hard
  • Fast, scalable, Resilient, most importantly, simple & correct

你可能感兴趣的:(Multi-threaded programming is hard)