This problem is based on reader writer concept, in which reader has the priority over writer. It deals with computing problems in concurrency. It consist of N number of threads in which some thread may read and some thread can write. In this both reader and writer threads are trying to access the same resource present in critical section. Reader: N numbers of reader are present here, but initially a single reader will try to enter the critical section and it will lock the entry of all the writer threads and increment the reader counter. Meanwhile, before going to the critical section the reader thread will unlock the mutex for reader threads and welcomes the entry of other reader thread into the critical section. When all reader will come out from the critical section it will unlock the writer mutex. Writer: When it comes to writer thread, if it gets chance to get into critical section than it will lock the entry of all other writer threads and it will update the shared variable inside the critical section. When it comes out from the critical section again it will unlock the entry of writer. Hence, in this way no reader shall be kept waiting if the share is currently allocated for reader thread, this is also called readers priority over writer.
-
Notifications
You must be signed in to change notification settings - Fork 0
debasishbhol/Operating-System
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published