yyu-nim / yyu-nim.github.io

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

https://yyu-nim.github.io/rust/lazy_static/event/crossbeam/2022/09/23/crossbeam-event-channel.html #12

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

lazy_static <1> - global event channel | Production-ready Rust Libraries (PRL)

Thread-safe concurrent application을 작성할 때 자주 사용되는 방법은, 두 쓰레드간 channel을 만들어 message를 통해서만 상태 변환을 하는 것이다. 메모리 주소를 다수의 쓰레드간 공유하는 방식과 비교해보면 lock의 획득 순서라던지, critical section 구간을 줄이기 위한

https://yyu-nim.github.io/rust/lazy_static/event/crossbeam/2022/09/23/crossbeam-event-channel.html

huijeong-kim commented 1 year ago

혹쉬,, poison pill을 두 번 하신 이유가 있나요? 첫 번째 poison pill 에서 receiver는 종료될 것 같아서요 ㅎㅎ

yyu-nim commented 1 year ago

와... 매의 눈이시네요! 예제를 조금 바꾸고 코드 복붙하다가 실수를;; github repo의 코드를 직접 블로그 포스트에서 볼 수 있게 한다던지 뭔가 방법을 찾아봐야 겠네요 ㅎ 감사합니다!