Consider a typical process P, in the critical section. Arrange the following statements of code to make a valid general structure.
(A) Critical section (B) Remainder section
(C) Entry section (D) Exit section
Choose the correct answer from the options given below:
Explanation
Solution:
Critical Section problem ko solve karne ke liye kisi bhi process ka structure char (4) mukhya bhaagon mein bata hota hai. Unka sahi kram niche di gayi equation se darshaya gaya hai:
Valid Structure=(C)→(A)→(D)→(B)
Yahan har section ka kaarya is prakar hai:
-
Entry Section (C): Yeh section process ko critical section mein jane ki permission maangne ke liye hota hai.
-
Critical Section (A): Yahan process shared resources ko access ya modify karta hai.
-
Exit Section (D): Yeh section doosre processes ko batata hai ki ab critical section khali hai.
-
Remainder Section (B): Isme bacha hua code hota hai jo shared resources par depend nahi karta.
Right Answer:
(C), (A), (D), (B)