attractivechaos / klib

A standalone and lightweight C library
http://attractivechaos.github.io/klib/
MIT License
4.18k stars 556 forks source link

Can I use read-write lock to guarantee thread-safe? #147

Open lxyscls opened 4 years ago

lxyscls commented 4 years ago

Hello, I am not sure that does the get op will modify the inner data. Under such situation, only lock will work, I think.

If not, can I use read-write lock? read lock to guard get op, write lock to guard set op.

Thank you.