 Lock-Free Atomic Shared Pointers Without a Split Reference Count? It Can Be Done!collection in C++ Some assumed knowledge • You’ve heard of lock-free programming and know what a compare_exchange is • You know roughly what atomic does and what it is used for • You’ve heard of shared_ptr collection in C++ Some assumed knowledge • You’ve heard of lock-free programming and know what a compare_exchange is • You know roughly what atomic does and what it is used for • You’ve heard of shared_ptr shared_ptr Lock-Free Atomic Shared Pointers Without a Split Reference Count? It Can Be Done!collection in C++ Some assumed knowledge • You’ve heard of lock-free programming and know what a compare_exchange is • You know roughly what atomic does and what it is used for • You’ve heard of shared_ptr collection in C++ Some assumed knowledge • You’ve heard of lock-free programming and know what a compare_exchange is • You know roughly what atomic does and what it is used for • You’ve heard of shared_ptr shared_ptr- load() • bool compare_exchange_weak(shared_ptr - & expected, shared_ptr - desired) • … compare_exchange(expected, desired) { if (current_value == expected) current_value = desired else expected 0 码力 | 45 页 | 5.12 MB | 6 月前3
共 1 条
- 1













