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,
mutabledata => Functional programming -
shared, mutable data => Message Passing: Actors -
shared, mutable=> Software Transactional Memory
- shared,
-
Concurreny is hard=> Threads and Locks are hard - Fast, scalable, Resilient, most importantly, simple & correct