Question

To Implement Mutual Exclusion some Parameters must be taken into consideration. Explain them, Also State the...

To Implement Mutual Exclusion some Parameters must be taken into consideration. Explain them, Also State the Attempts to Implement Mutual Exclusion.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

There are mainly three parameters needed to achieve mutual exclusion. they are:

  1. Interrupts.
  2. Lock variable or mutex.
  3. semaphores.

Interrupts:

  • process disables interrupts while entering critical section.
  • It re enables interrupts while leaving critical section.
  • cpu cannot be switched when interrupts are turned off.
  • occurs within kernel of operating system.

Lock or mutex:

  • single shared variable initially 0.
  • when a process enters critical section it sets lock to 1.
  • when it leaves critical section it again sets it back to 0.
  • if lock value is already 1 then the process waits.

semaphore:

  • integer variable.
  • controls access of resources by multiple processors.
  • accessed through two operations signal and wait.
  • implements mutual exclusion.
  • two types: binary semaphore(0 and 1), counting semaphore ( arbitary resource count).

Implementation of mutual exclusion:

  • when one process is in critical section no other process can enter it. this is called mutual exclusion.
  • when a process wants to enter the critical section it disables all the interrrupts.
  • and uses the critical section.
  • it will then set the lock variable to 1.
  • so no other process can enter the critical section.
  • when the process has completed using the critical section it will re enable all the interrupts.
  • and set the lock variable back to 0.
  • now the other processes can compete to enter the critical section.
  • This is also possible using the semaphore variable using the functions signal and wait.
  • when a process wants to enter critical section it will call the function wait on the semaphore.
  • during this time no other process can enter the critical section.
  • when it leaves the critical section it will call the signal function on the semaphore variable.
  • and then set the lock variable back to 0.
  • hence ensuring mutual exclusion.

hope this was helpful!

Add a comment
Know the answer?
Add Answer to:
To Implement Mutual Exclusion some Parameters must be taken into consideration. Explain them, Also State the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assume that we desire to have deadlock-free mutual exclusion using locks on a shared object implemented...

    Assume that we desire to have deadlock-free mutual exclusion using locks on a shared object implemented via a set of shared registers. Suppose we allow threads to go through the lock method without writing to any of the shared registers? In general, it will be impossible to tell if a thread is in the critical section by examining the shared object. It will result in deadlocks. Both (a) and (b) Neither (a) nor (b) Suppose a thread attempts to lock...

  • Answer the four of them, please For a TRUE statement you must explain and prove in...

    Answer the four of them, please For a TRUE statement you must explain and prove in general why it is true. For a FALSE statement you must give a COUNTEREXAMPLE. For example of a counterexample, if the state- ment was "An even number divided by an even number is always ever" your counterexample could be 6 : 2 = 3 where 6 and 2 are even but 3 is obviously odd. Question 7 Suppose an> 0 Vn. Further suppose a...

  • In 1985, State Farm Mutual Insurance issued Casto an automobile insurance policy on her Jaguar. Casto...

    In 1985, State Farm Mutual Insurance issued Casto an automobile insurance policy on her Jaguar. Casto also insured a second car, a Porsche, with State Farm. Some time in September or early October 1987, Casto received two renewal notices for her policy on the Jaguar, indicating that the next premium was due on October 10, 1987. State Farm sent a notice of cancellation on October 15, indicating that the policy would be canceled on October 29. Casto denied having received...

  • Write five interview questions and also answer them and explain how that will be apt while recrui...

    Write five interview questions and also answer them and explain how that will be apt while recruiting for "credit card collections" representative position, you should be using a structured interview. Describe briefly why you feel these questions as necessary and how they help in scaling the candidates for the interview. Include a rubric/scoring guide for the answers for each question. NOTE:- State the Main heading in few words that support your answer as a recommendation. And support your explanation with...

  • Identify three accounting software packages that you would consider for a small business. Explain what must...

    Identify three accounting software packages that you would consider for a small business. Explain what must be taken into consideration when selecting small business accounting software. And, state why the quality of record-keeping is so important in track business finances for accurate record keeping.   Highlight the key discoveries of your accounting software research: Compare and contrast the three-software accounting software you have selected with a focus on record management. Then, discuss the advantages and disadvantages that each accounting software package...

  • Please answer c,d,f. also please explain the answers for me to understand. For each of the...

    Please answer c,d,f. also please explain the answers for me to understand. For each of the languages below, draw the state diagram for a nondeterministic finite automaton (NFA) to accept the language. In order to get full marks, your NFA must have the number of states specified, and it must take advantage of nondeterminism. [There must be at least one case where the machine has a choice between two or more next states on some input symbol, or a case...

  • Could some one help me i have to write an essay about this and it need...

    Could some one help me i have to write an essay about this and it need to be in detail Please discuss the mechanism that pseudomonas aeruginosa, Staphylococcus aureus,Propionibacterium acnes and streptococcus progenies utilize to cause disease on skin and in the eyes. You must state what disease these microorganism cause. In addition, [lease list and explain the host immune defenses that the microbe would have to overcome to be successful at causing disease ( include a discussion what role...

  • Question: Explain how the traditional approach and modern portfolio theory can be blended into an approach...

    Question: Explain how the traditional approach and modern portfolio theory can be blended into an approach to portfolio management that might prove useful to the individual investor. Relate this to reconciling Walt’s and Shane’s differing points of view. Walt Davies and Shane O’Brien are district managers for Lee, Inc. Over time, as they moved through the firm’s sales organization, they became close friends. Walt, who is 33 years old, currently lives in Princeton, New Jersey. Shane, who is 35, lives...

  • When performing a gap analysis, one must have an understanding of the desired future or "to be" state. For cybersecurity focused gap analyses, we frequently use IT security controls as the mea...

    When performing a gap analysis, one must have an understanding of the desired future or "to be" state. For cybersecurity focused gap analyses, we frequently use IT security controls as the means by which we describe the "to be" (or "should be") state of IT systems and Information Security Management Programs. There are a variety of guidance documents which list and define sets of security controls. Each of these documents or sets of controls has an underlying framework. One of...

  • The differences & similarities between the federal & state court systems. 2. The structure of the...

    The differences & similarities between the federal & state court systems. 2. The structure of the Washington state court system; i.e. the trial court of general jurisdiction, the intermediate appellate court, the state supreme court. 3. Remember, Washington is in the 9 th Circuit Court of Appeals. 4. Under both the Washington state and federal court system, there is one appeal as of right. Appeals to the Washington Supreme Court(in the state system), or to the U.S. Supreme Court in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT