지금 해당 코드에 대해서 4번째 의심하고있는 학생입니다. 찾아보니 유사한 질문이 있음에도 이해가 되질 않아 먼저 해당 글부터 링크 걸어두겠습니다. https://www.inflearn.com/questions/365349 _pendingList와 _popCount를 atomic으로 선언해서 사용하고 있는 상황인데 if (_popCount == 1) { // 여기부터 Node* node = _pendingList.exchange(nullptr); // 이 사이에 if (--_popCount == 0) { DeleteNode(node); } else if (node) { ChainPendingNodeList(node); } delete oldHead; 저 주석 사이에 둘 이상의 스레드가 동시에 접근 할 수 있는 건가요? 그리고 접근 할 수 있어도, 혹은 다른 함수에서(ChainPendingNodeList) _pendingList에 접근을 시도해도 exchange 연산을 통해 분리해내는데 둘 이상의 스레드가 동시에 같은 포인터를 잡고있는 상황이 있을 수 있나요?
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을 선택하는 대표적인 기준은 무엇인가요?
코드를 따라치면서 컴파일해보다가 14분 30즘에 나온 방식으로 atomic<int32> sum = 0; 으로 치고 컴파일 했을 때 -std=c++11과 -std=c++14로는 에러가 났습니다. 1) atomic은 C++ 버전 몇에서 표준화되고 추가되었나요? 2) 지금은 모든 Makefile의 CXXFLAGS에 -std=c++17를 추가해 통일시켜놨는데 앞으로 나오는 강의를 기준으로 C++17로 괜찮을까요? 아니면 해당강의에 맞는 추천버전이 있으신가요?