compare_exchange_strong과 compare_exchange_weak
해결됨
[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part4: 게임 서버
compare_exchange에 해당하는 두가지 함수가 있기에 궁금하여 해당 내용을 찾아보았지만 이해가 가지 않습니다. https://cplusplus.com/reference/atomic/atomic/compare_exchange_strong/ Unlike compare_exchange_weak , this strong version is required to always return true when expected indeed compares equal to the contained object , not allowing spurious failures . However, on certain machines, and for certain algorithms that check this in a loop, compare_exchange_weak may lead to significantly better performance. 1) spurious failures? weak는 해당 오류가 어떻게 나올 수 있다는 걸까요? 2) weak와 strong을 선택하는 대표적인 기준은 무엇인가요?
- c++
- atomic
- MMORPG
- compare_exchange
- windows-server
- network
장인석
댓글 1
좋아요 0
조회수 1185





