분산 시스템 간 공유 변수에 대한 고찰
Memory model (컴퓨터는 released consistency + weak consistency를 통해 동작한다.)
1. Sequential Consistency
- Memory local ordering
- interleaving with other pCPU
2. Released Consistency
- only kept memory ordering with explicit dependency
- if W(A) -> W(B) -> R(A), W(A) -> R(A) ordering is kept, but A and B does not have any dependency relations, which yields instruction level rescheduling
- Thus, we could not say W(A) happens before W(B)
- used for superscalar architecture (instruction level parallelism)
3. Weak Consistency
- Only apply sequential consistency to synchronization variable
- If W(A) -> W(B) -> R(A), and A and B are sync variables, the order is kept
- If W(A) -> W(B) -> W(C) -> R(A), and A and B are sync variables, and C is not sync variable, operation on C can be reordered
Ordering
1. Acquire - Release, When acquire is called in thread A, thread B after release can see all the stored variable
2. Consume - Release, When consume is called in thread A, thread B after release can see only dependent lately stored variable
3. Relaxed, weak consistency
분산갤로