There is a common problem : read/write problem in which only one writer is allowed to write but multiple readers can read. It is usually implemented by semaphores. Can we use condition variables to solve this problem as well?
Asked
Active
Viewed 362 times
0
-
Don't see why not...... – Martin James Oct 19 '15 at 21:07
-
@MartinJames I tried solving it but couldn't. How can we let multiple users access reading function in parallel. Doesn't wait() and signal() let only one thread to perform execution. ? – puffles Oct 20 '15 at 03:09
-
check this link http://stackoverflow.com/questions/3513045/conditional-variable-vs-semaphore – incompetent Oct 20 '15 at 14:49
-
You can find some related information in this link : http://stackoverflow.com/questions/4039899/when-should-we-use-mutex-and-when-should-we-use-semaphore – Karthik Balaguru Oct 20 '15 at 16:51