Operating Systems
how do semaphores support mutual exclusion ?
Answer:-
First of all semaphore is variable used to solve critical section problem.
There are two operations in semaphores. one is wait() and another one is signal()
implementation of wait:-
wait(Semaphore s)
{
while(s==0); //wait untill s==0//
s = s-1 //decrements semaphore value
}
implementation of signal:-
signal(Semaphore s)
{
s = s+1;
}
support for mutual exclusion through semaphore:-
first of all semaphore initialized to 1 and p1 and p2 are two processes
step1:- s=1 p1,p2 //not in critical section//
step2:- if p1 enters into critical section.
it will call wait() operation
then s =0
step3:- another process p2 can not enter critical section until p1 calls signal opeartion //supports mutual exclusion//
step4:- p1 completes its operation then calls signal() function
step:-now s=1 then p2 can enter critical section.
process will implement following procedure for mutual exclusion:-
while(True)
{
//non critical section//
wait(s);
//critical section//
signal(s);
}
Why do some operating systems support specific types of file structures and why do some operating systems don’t?
P(sem) and V(sem) operations on semaphores are executed atomically. What will be the outcome of not executing P(sem) atomically? Specify where the interrupt occurs. Give one execution sequence of concurrent processes that will show a specific Condition (Mutual Exclusion or Starvation or Progress Condition) violated. Be detailed in your explanation.
Many mutual exclusion algorithms are verified using computer programs. Briefly outline how these programs manage to verify that a certain algorithm is correct.
In all computer system, there is a component of the system which provides fundamental mutual exclusion protection. what is this component, why does it provide mutual exclusion and why is it insufficient to protect against asynchrony?
Why might it be considered bad practice to use a spinlock to enforce mutual exclusion on a computer with one core, but be acceptable to do so on a computer with multiple cores?
To Implement Mutual Exclusion some Parameters must be taken into consideration. Explain them, Also State the Attempts to Implement Mutual Exclusion.
Describe how Lotka-Volterra competition models support the competitive exclusion principle. (2 pages)
What are the primary benefits of clinical decision support systems? How do you feel this will impact patient safety?
What are primary benefits of the clinical decision support systems? How do you feel this will impact patient safety?
Operating Systems Concepts Why are special purpose machine instructions inefficient? What are the two most common techniques, supported by the operating system, that are more efficient solution than special purpose machine instructions? What are the two general uses of semaphores?