mutex is used for the readCounter as it also a critical section part so mutex is used so that there is no error with respect to readCount. wrt is used to lock operation between read and write.
bhai pheli baat toh bahut shukriya ye share krne ke liye it was much needed also bhai ek doubt bss ye bta do ki basically mutex is keeping count for the number of read operations rgt ?
Thank you so much mam.. I have seen your first video about postfix and now have seen this fully.. Mam your explanation is just ossm mam.. From depth of my heart THANK YOU MAM☺️
I suppose your doubt is related to the writer only waiting for the wrt semaphore. Actually only this is required as the wrt semaphore will be locked whenever a reader enters. So it has to just wait for wrt to ensure no reading is going on.