Does it satisfy Mutual Exclusion?

flag[i]=false; 
while(true){ 
       flag[i]=true;
            while( flag[1-i]) 
                { 
                  flag[i]=false;
                     while( flag[1-i])
                        { 
                         no-op;
                        } 
          flag[i[=true;}
        <critical section>
         flag[i]=false;
       remainder section

 DOES IT SATISFY MUTUAL EXCLUSION?
 

3Comments
Anmolpreet Kaur @anmol1933
14 Jan 2016 12:26 am
Please someone answer this
chitaranjan sahu @chitaranjansahu
14 Jan 2016 08:05 pm

yes it satifies clearly . by taking two process put one process in CS and try to put the other process if both are in CS then it is not satifires the mutual exclusion .therwise it satifire 

Parimal Andhalkar @parimal_andhalkar
14 Jan 2016 08:43 pm

Its Two process solution, following are possible

  • Mutual Exclusion
  • Bounded Waiting
  • Progress
  • Architecture Neutral
  • Busy waiting solution
  • No deadlock

Pages