yyu-nim / yyu-nim.github.io

Production-ready Rust Libraries (PRL)
5 stars 0 forks source link

https://yyu-nim.github.io/actix/rust/crossbeam/shardedlock/2022/08/15/crossbeam-shardedlock.html #8

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

crossbeam <4> - sharded lock | Production-ready Rust Libraries (PRL)

State machine을 구현하다 보면, 이런 경우에 고민이 될 수 있다: “State A 에서 State B로 전환을 해야 하는데, State A에서 외부 Event가 들어오지 않도록 잠깐 막고 싶다”.

https://yyu-nim.github.io/actix/rust/crossbeam/shardedlock/2022/08/15/crossbeam-shardedlock.html

huijeong-kim commented 2 years ago

Writer lock이 획득된 상태에서, lock owner thread가 panic으로 죽게 되면, 그 lock의 상태는 poisoned로 정의되고, read() 호출의 결과로 Error가 리턴되므로, 이에 대한 처리가 필요하다. => 이런거 진짜 좋은 것 같아요! cpp에서 쓰던 rw lock을 생각한다면 여긴 신세계네요 ㅎㅎ