Closed mheily closed 3 years ago
This pertains to #103 but does not fix the problem.
Also some unused functions in map.c were removed.
Using mutexes like this would significantly increase contention on the map array. I'd like to understand why tsan is throwing errors first. They may be false positives.
Switching to C11 atomics, fixing map_delete
to use atomic_exchange
, and using atomic_load
when accessing atomic variables silences TSAN's complaints. https://github.com/mheily/libkqueue/commit/f3eab262fcf961cfd465c0f52fa6896a4782aca2
There's still an issue with mutex use after destruction that we need to look at.
I don't see a good reason to use atomic operations in map.c.
Let's use a rwlock instead.