concurrent readers and mutually excluding writers in C using pthreads
问题 I was hoping if someone could forward me or show me a program that has multiple readers yet mutually excluding writers in C. I searched the entire internet for it, and could not find a single example that displays this behavior using coarse-grained locking. I know I can use pthread_rwlock_init, pthread_rwlock_rdlock, etc, I just don know how to use it. I learn by examples, which is why Im here. Suppose I have a region of code(not a shared variable)and I want multiple reads, yet a single