

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A research project proposing to simulate and analyze the efficiency of three different approaches to the readers-writers problem (rwp) in concurrent systems. The rwp is a classic problem in computer science where processes attempt to access shared memory for reading or writing. The concurrent read, exclusive write (crew) model and compares it to the reader's preference, writer's preference, and no preference models. The project aims to determine under which scenarios certain solutions cause processes to starve and to develop a new approach to prevent starvation.
Typology: Study Guides, Projects, Research
1 / 2
This page cannot be seen from the preview
Don't miss anything!
Kyle Robinson
In concurrent systems, the rules for organizing access of separate processes to shared memory can be complicated because there are many different scenarios. In an earlier project, fellow classmates and I simulated a solution to the Dining Philosopher’s problem which is made up of processes in a circle which access two separate items, each of which is shared with only their neighbor, one to their left, and one to their right. The solution was drastically simple compared to real-world concurrency issues because of the predefined low number of shared resources and neighbors. Because of this, our solution does not translate well to other types of concurrency problems.
For my next project, I propose to simulate a larger concurrency problem, the Readers- Writers Problem (RWP). In a RWP, processes attempt to access shared pieces of memory for one of two reasons, to read or to write. It would be easy enough to implement a simple queue on each piece of memory and allow access to only one process at a time using a mutex or semaphore. However, for example, if two processes both wish to access memory for reading purposes, then there is no reason to wait for one to finish before the other can begin because reading processes do not interfere with each other. I will implement and test a Concurrent Read, Exclusive Write (CREW) model in which a processes being read can be read by multiple processes at the same time^1 (See figure 1). This is different from the Exclusive Read, Exclusive Write (EREW) model in which at most one process can be accessing a piece of memory at any given time^2.
Figure 1: CREW model for memory access. Reading processes can be concurrent with other reading processes, but writing processes must be exclusive.
(^1) NIST. Concurrent Read, Exclusive Write. Retrieved from http://www.itl.nist.gov/div897/sqg/dads/HTML/concurrentReadExcluWrt.html (^2) NIST. Exclusive Read, Exclusive Write. Retrieved from
http://www.itl.nist.gov/div897/sqg/dads/HTML/exclusiveReadExcluWrt.html
Using MPI to simulate and finely control CREW-modeled memory and processes that request to access them, I will analyze efficiency for three separate RWP solution approaches. I am most interested in determining under which scenarios that certain solutions cause processes to starve and how this situation can be avoided. It is my goal that this analysis will lead to a fourth approach to RWP which can allow memory to adapt to requests and change its access rules to be the most efficient and prevent starvation.
According to Wikipedia, there are three different forms of RWP^3 , by which it means that there are three different solution approaches.
A no-preference model is a balance between the two above models. By enqueuing all processes despite access type, it is guaranteed that no process starves. This model still allows for multiple reads if reading processes are given access at the same time or if a reading process requests access when there are no writing processes in the queue. While guaranteeing that no process starves, this model might not be the most efficient of the three models. My project will attempt to determine if this is so.
These models will be simulated using an MPI model in which separate processes will be used to simulate reading and writing processes as well as the queue management for the shared memory. There will also be a user interface process that will be used to interact with the user running the test, advance units of time in the other processes using clock tick messages, and compile/print reports sent from the other processes. The reports will contain information on the length of time processes waited to gain access to shared memory, the length of time that memory was accessed for reading and writing, and measurements for efficiency of the solution. This information will lead to a better understanding of how different solutions handle in different scenarios which will hopefully lead to a new approach/solution to RWP.
(^3) Wikipedia. Readers-writers problem. Retrieved from
http://en.wikipedia.org/wiki/Readers-writers_problem