recategorized by
2,153 views

1 Answer

Best answer
9 9 votes

critical section anything...file,code,memory,register,colddrink,food which is "shared" by two processes..

mutual exclusion...if a process is inside the critical section.....other process shouldnt enter inside...like u r in a washroom..till that time no one should enter..

semaphore...a "variable"...a protected variable on which read modify etc happens automatically in kernal mode....like before entering washroom u have kept a bodygaurd ouside who will prevent others from entering..and when u comes out...it is removed...P and V are the operations to do so...

selected by
Position:
Show:

Related questions

0 0 votes
1 1 answer
1.5k
1.5k views
humblefool asked Dec 13, 2017
1,537 views
Process P1Process P2P(S1)P(S1)P(S2)P(S2)Critical SectionCritical SectionV(S2)V(S1)V(S1)V(S2)In one of the Gateoverflow tests, this question was given and it was told that...
11 11 votes
1 answers 1 answer
15.5k
15.5k views
pC asked Oct 6, 2016
15,459 views
Dekkers Algorithmflag[0]=true; while(flag ==true) { if(turn!=0) { flag[0]=false; while(turn!=0); flag[0]=true; } } // CS turn=1; flag[0]=false;Peterson Algorithm flag[0]=...
0 0 votes
2 2 answers
2.2k
2.2k views
shivajikobardan asked Jul 22, 2023
2,190 views
Sorry if this is a stupid question. But it really intrigued me. Same resources at different algorithms are telling different ways to test these stuffs.Here's an algorith...