6elec7mutex - Mutual Exclusion System involving multiple...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Mutual Exclusion System involving multiple processes are often most easily programmed using critical regions. When a process has to read or update certain shared data structures, it first enters a critical region to achieve mutual exclusion and ensure that no more than one process can use the shared data structure at the same time. In single-processor system, critical regions are protected using semaphores, monitors, and similar constructs. In a distributed systems, mutual exclusion can be enforced by the following methods: A Centralized Algorithm A Distributed Algorithm A Token Ring Algorithm We will study each of these algorithms and do a comparison among them.
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
A Centralized Algorithm One process is elected to be the co-ordinator -- For example, the process that bears with the highest network address. When a process wants to enter a critical region, it sends a request message to the co- ordinator stating which critical region it wants to enter. If no other process is currently in that CR, the co-ordinator sends back a reply granting the permission. When the reply arrives, the requesting process enters the CR. If some other process is already inside the CR, the co-ordinator will queue the request and either send a “permission denied” message back or no reply at all. When a process exits the CR, it sends a message to the co-ordinator releasing its exclusive access. The co-ordinator will then takes the first item off the queue of deferred requests and sends that process a grant message. If the process is still blocked, it enters the CR. If an “denied” message has been sent, the process will have to poll for incoming traffic. Either way, upon receiving the grant, it enters the CR. Advantages: Fair & no starvation (FIFO), and only 3 msg type -- request, grant, release.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern