1. Concurrency

2017-08-09  本文已影响0人  何大炮

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:

  1. non-deterministic phenomenon
  2. non-observable system state
  3. results may not depend on the input and parameters
  4. non-reproducible

Attention:

  1. the program that is concurrent on the higher abstraction level is always sequential on the lower abstraction level.
  2. 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:

  1. contention(implicit): concurrent tasks compete for a shared resource.
  2. 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.

上一篇下一篇

猜你喜欢

热点阅读