Vault sync: 2022-01-26 22:19:35
This commit is contained in:
parent
5d724f868d
commit
1711349f6d
@ -111,10 +111,29 @@ These bugs are hard to detect and fix.
|
|||||||
# Correctness
|
# Correctness
|
||||||
Sequetial programs wil always give the same result. Debugging makes sense.
|
Sequetial programs wil always give the same result. Debugging makes sense.
|
||||||
|
|
||||||
Concurrent programs do not behave like this. Some instances may give correct output and some not.
|
Concurrent programs do not behave like this. Some instances may give correct output and some not. (Without protections)
|
||||||
|
|
||||||
|
This implies that we cannot debug a concurrent program in the
|
||||||
|
normal way, because each time we run the program, we will likely
|
||||||
|
have a different order of interleaving.
|
||||||
|
|
||||||
|
Correctness of (non-terminating) concurrent programs is defined in
|
||||||
|
terms of properties of computations, rather than a functional result.
|
||||||
|
|
||||||
|
Types:
|
||||||
|
- Safety properties: the property must always be true.
|
||||||
|
Example: Always, mouse cursor is displayed.
|
||||||
|
|
||||||
|
- Liveness properties: The property must become true at some point.
|
||||||
|
Example: Click with a mouse, eventually the mouse cursor changes.
|
||||||
|
|
||||||
|
# Fairness
|
||||||
|
Arbitrary interleaving assumes no order of speed executing statements for diffrent processes/tasks.
|
||||||
|
- However, it does not make sense to assume that statements from any
|
||||||
|
specific process are never selected in the interleaving.
|
||||||
|
|
||||||
|
A scenario of executing statements is (weakly) fair if a statement that
|
||||||
|
is continually enabled, eventually is selected to execute.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user