How to define the "Concurrency":
If there is no observer who can identify 2 events in the strict sequence, then the 2 event can be considered as concurrency.
what kind of chaos concurrency can make:
- non-deterministic phenomenon
- non-observable system state
- results may not depend on the input and parameters
- non-reproducible
Attention:
- the program that is concurrent on the higher abstraction level is always sequential on the lower abstraction level.
- vise versa.
Concurrent program: several sequential process or threads are executed concurrently.
From now on, we need to interact so that those tasks can be executed concurrently.
"Interaction" has 2 forms:
- contention(implicit): concurrent tasks compete for a shared resource.
- communication(explicit): information passing or synchronisation.
To solve those problem, we consider the sequence of interaction points, that is, hold true for every possible sequence of interaction points.(interleavings)
The correctness of Concurrency: having the input, then we are able to obtain the output and the relationship between output and input.
There are also 2 properties of Concurrency : Safety and Liveness
A concurrent system is a system in which multiple task can be executed at the same time.
网友评论