rcu


1. Reader-Writer Lock Implementation

#include <atomic>
#include <mutex>

class RCU {
public:
    void lock_for_reading() {
        ++readers_;
    }

    void unlock_after_reading() {
        --readers_;
    }

    void lock_for_writing() {
        while (readers_.load() != 0) {}
        ++writers_;
    }

    void unlock_after_writing() {
        --writers_;
    }

private:
    std::atomic<int> readers_{0};
    std::atomic<int> writers_{0};
};

2. Reference Counting with RCU

3. Concurrent Queue with RCU

4. Concurrent Map with RCU

5. Time-Stamped Vector with RCU

6. Lock-Free Stack with RCU

7. Non-Blocking Skip List with RCU

8. Concurrent Linked List with RCU

9. Concurrent Binary Tree with RCU

10. Concurrent Hash Table with RCU

11. Concurrent Graph with RCU

12. Concurrent Bloom Filter with RCU

13. Concurrent Set with RCU

14. Concurrent Counter with RCU

15. Concurrent Queue with Multiple Readers and Single Writer (MRWS)

16. Concurrent Queue with Graceful Shutdown

17. Concurrent Queue with Batched Processing

18. Concurrent Queue with Reader-Writer Locks

19. Concurrent Queue with Wait-Free Read

20. Concurrent Queue with Lock-Free Insertion

21. Concurrent Queue with Lock-Free Deletion

22. Concurrent Queue with Wait-Free Enqueue and Dequeue

23. Concurrent Stack with RCU