티스토리 뷰
Consensus is universal (만능)
n-thread consensus build (wait-free, linearizable, n-threaded implementation, any sequentially specified object)
wait-free - stronger (system), lock-free (per thread)
Lock-free : infinitely often some method call finishes (how to prevent starve)
Wait-free : each method call takes a finite number of steps to finish
lock 없이 execution order를 만들기 위해 도움을 받아야 함. 만약 실패한다면 새 상태를 포인팅 해야 함
consensus state return new state
중요 : 아래 내용은 enqueuer와 dequeuer각각 하나의 쓰레드만 있을 때 적용되는 사항
Decide는 2-consensus를 해결해줌
상태가 갈리는 안 좋은 예시
Next pointer points next method. Decide uniquely.
If fail, step back and re read - not violate
linked list - global execution order
마지막까지 읽은 후에 내 method를 추가
아래 그림까지는 Linearizable 한 상태이고 Lock-free & Wait-free 상태는 아님
중요 : 아래 내용부터 Universal Construction (n consensus)
Threads use one-time consensus object to decide which node goes next
Threads update actual next field to reflect consensus outcome
Unique global order is important
Global execution order need uniquely -> n 개의 쓰레드가 합의 가 가능하다 consensus number n
Bottleneck -> sequentially execution , so make concurrently
유니크한 global order를 사용하는 것으로 Lock-free implement
아래 그림 - 하지만 실패 시 계속 찾아가야 하므로, Wait-free는 안됨
Wait-free로 만드는 방법
가장 빠른 쓰레드와, 느린 쓰레드의 distance를 제한하는 것이 wait-free가 됨
finite step n에 모두 다 끝남
Announce array를 사용
'개발 > 병렬프로그래밍' 카테고리의 다른 글
[병렬프로그래밍] Concurrent Objects, 마치며 (0) | 2019.12.17 |
---|---|
[병렬프로그래밍] Spin Lock (0) | 2019.12.17 |
[병렬프로그래밍] Consensus (0) | 2019.12.17 |
[병렬프로그래밍] Shared Memory (0) | 2019.12.17 |
[병렬프로그래밍] Concurrent Objects (0) | 2019.12.17 |
- Total
- Today
- Yesterday
- boost
- SuffixArray
- red underline
- RVO
- hole-punching
- 면접
- 코어 남기기
- vr핏
- shared_from_this
- cockroach db
- print shared_ptr class member variable
- Reciprocal n-body Collision Avoidance
- C++
- Golang
- mysql
- 봄날에 스케치
- 잘못된 빨간줄
- Obstacle Avoidance
- set value
- vrpit
- 에러 위치 찾기
- ad skip
- Visual Studio
- Quest2
- 우리는 vr핏이라고 부릅니다
- 영상 픽셀화 하기
- it's called a vrpit
- chrome-extension
- 카카오
- 클래스 맴버 변수 출력하기
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |