Important Concepts
- Synchronous (synchronous) and asynchronous (asynchronous)
- Synchronous Wait method returns
- Asynchronously returns, continuing the next call
- Concurrency (Concurrency) and parallelism (Parallelism)
- Concurrency is consistent with parallel external performance
- Single-core CPUs cannot be parallelized, but can handle parallel transactions
- Critical section
- Public resources or shared data
- Critical section data corruption may occur when accessing multiple threads
- Blocking (Blocking) and non-blocking (non-blocking)
- Non-blocking allows multiple threads to enter the critical section at the same time
- Deadlock (Deadlock), hunger (starvation) and live lock (Livelock)
- Deadlock cannot stop service, static problem. Cyclic dependency
- Live lock Dynamic Lock, run-time resource requisition
- Hunger is lacking in certain resources and is always impossible to enforce
Concurrency level
- Blocking
- Non-blocking
- Barrier-Free
- No lock
- No wait
Amdahl Law (Amdahl Law)
Acceleration ratio Definition:
Acceleration ratio = System time-consuming/optimized system time before optimization
Gustafson Law (Gustafson)
Practical Java high Concurrency programming 1