Reputation: 5897
I've got a data structure that could be read simultaneously by 100s of threads, but naturally write/write and write/read conflicts must be avoided. My 1st attempt with pthread_mutex_lock prevented multiple reads. What would be a good way, using pthreads, to prevent write/write and write/read while allowing multiple reads?
Upvotes: 2
Views: 51
Reputation: 58524
A great way would be to use the native rwlock facility from pthreads itself.
Upvotes: 1