Vault sync: 2022-01-26 22:14:35
This commit is contained in:
parent
87c32f2f3b
commit
5d724f868d
@ -89,7 +89,29 @@ Execution of concurrent program proceeds by executing a sequence of the statemen
|
|||||||
p1->q2->p2->q1 is not possible. because we are breaking the order of execution of program q. q must execute q1 before q2.
|
p1->q2->p2->q1 is not possible. because we are breaking the order of execution of program q. q must execute q1 before q2.
|
||||||
|
|
||||||
# Atomic statement
|
# Atomic statement
|
||||||
|
Atomic statement model assumes that a statement is executed to completion without the possibility of interleaving statements from other process.
|
||||||
|
|
||||||
|
Main property of atomic statement is: they cant be divided.
|
||||||
|
|
||||||
|
A single machine level instruction is always atomic.
|
||||||
|
|
||||||
|
|
||||||
|
# Tracing & testing
|
||||||
|
|
||||||
|
concurrent programs are hard to develop and test.
|
||||||
|
|
||||||
|
Concurrency bugs:
|
||||||
|
|
||||||
|
- Simultaneous access same db record
|
||||||
|
- Atomicity violatitions
|
||||||
|
- Deadlocks
|
||||||
|
|
||||||
|
These bugs are hard to detect and fix.
|
||||||
|
|
||||||
|
# Correctness
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user