C multithreading reader and writer problem
I want to create a program where there are 2 threads reader and writer.
Both reader and writer runs for 10 iterations.
I need a synchronization mechanism that can enable reader and writer execute alternatively.
I tried only with mutex but it did not work. So I used conditional wait, still I could not achieve the results and the code is in infinite wait state. Below is the code that I tried.