![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FJJFmf%2FbtqFknot3BF%2Fb6HfwdChgXekjIl0L9K7r1%2Fimg.png)
[c++] CAS 구현 및 ABA 문제 해결 :: mutex(spin lock)와의 비교
Mutex와의 비교 코드 #include #include #include #include #include #include using namespace std; class Node { public: int value; Node* next; Node() : value(0) { next = NULL; } Node(int k_value) { next = NULL; value = k_value; } }; int node_n; //random 구현 random_device rd; mt19937 gen(rd()); uniform_int_distribution dis(0, 10); //출력을 위한 mutex mutex mut; class LFStack { private: Node * head; public: void ..
Comment