In the implementation of urcu-qsbr, users can use urcu_qsbr_thread_online and urcu_qsbr_thread_offline to mark a critical section for reading.

Here's offline/online

Writers then use urcu_qsbr_synchronize_rcu to check whether the thread is online (ACTIVE) and whether the thread-local counter matches the shared counter to confirm whether the thread has seen the previous modifications.

Here's wait_for_readers

However, is there a potential scenario where a thread, after going offline, immediately goes online and reads old data, while the writer has not timely detected this thread is online, leading to the erroneous recycling of data? Is there any mechanism to ensure this? From my understanding, memory barriers can only ensure the visibility of the order of operations in a thread, but cannot guarantee the visibility of modifications within a bounded time frame between threads.

In my understanding, the concepts of online and offline in urcu-qsbr seem analogous to registering and unregistering, requiring a mutex-like mechanism to ensure synchronization between reader threads and writer threads.

0

There are 0 best solutions below