However, this solution is sub-optimal, because it is possible that a reader R 1 might have the lock, and then another reader R 2 requests access. It is possible to protect the shared data behind a mutual exclusion mutex, in which case no two threads can access the data at the same time. Suppose we have a shared memory area (critical section) with the basic constraints detailed above. The basic reader–writers problem was first formulated and solved by Courtois et al. A readers–writer lock is a data structure that solves one or more of the readers–writers problems. (In particular, we want to prevent more than one thread modifying the shared resource simultaneously and allow for two or more readers to access the shared resource at the same time). Some threads may read and some may write, with the constraint that no thread may access the shared resource for either reading or writing while another thread is in the act of writing to it. There are at least three variations of the problems, which deal with situations in which many concurrent threads of execution try to access the same shared resource at one time. In computer science, the readers–writers problems are examples of a common computing problem in concurrency. ( Learn how and when to remove this template message) ( November 2016) ( Learn how and when to remove this template message) Please help improve it to make it understandable to non-experts, without removing the technical details. This article may be too technical for most readers to understand.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |