You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of using the old implementation of thread-rcu [1], let's use
the newest and correct one, thread-rcu/rcu.h. And, to avoid the data
race while we traverse the linked list, introduce the for loop API,
list_for_each_entry_rcu.
After we changed the implementation and used the new for loop API, it
doesn't report the data race:
$ make
cc -o test test.c -g -Wall -std=c99 -fsanitize=thread -D'READER_NUM=10' -D'UPDATER_NUM=1' -D'TRACE_LOOP=1000' -D'CONFIG_TRACE_TIME' -lpthread
$ ./test
[tracer] loop 1000 : 2367069575.000000 ns
[1] https://github.com/linD026/parallel-programs/blob/main/rcu/thrd-based-rcu/thrd_rcu.h
0 commit comments