A critical section is a program segment
Answer: C) where shared resources are accessed.
A Critical Section is a part of a program where a process accesses shared resources, such as shared variables, files, memory, or devices.
When multiple processes access the same shared resource, problems such as race conditions may occur. Therefore, a critical section must be protected so that only one process accesses the shared resource at a time when mutual exclusion is required.
- A: Refers to a time constraint, not the definition of a critical section.
- B: A critical section does not itself guarantee the prevention of deadlocks.
- C: Correct — it is the program segment where shared resources are accessed.
- D: Semaphore operations (P and V) are one way to protect a critical section, but they are not compulsory in every implementation.
Critical Section भनेको Program को त्यस्तो भाग हो जहाँ कुनै Process ले साझा स्रोतहरू (Shared Resources) Access गर्छ।
उदाहरणका लागि, धेरै Processes ले एउटै Shared Variable, File, Memory वा Device प्रयोग गर्दा Race Condition हुन सक्छ। त्यसैले आवश्यक अवस्थामा Critical Section लाई यसरी सुरक्षित गरिन्छ कि एक पटकमा एउटा मात्र Process ले Shared Resource Access गर्न सकोस्।
- A: निश्चित समयसीमासँग सम्बन्धित कुरा हो।
- B: Critical Section ले आफैँ Deadlock रोक्ने ग्यारेन्टी गर्दैन।
- C: सही — Shared Resources Access गरिने Program Segment हो।
- D: Semaphore (P र V) Critical Section सुरक्षित गर्ने एउटा तरिका हो, तर अनिवार्य रूपमा यही प्रयोग गर्नुपर्छ भन्ने छैन।
Exam Tip: Critical Section = Program को त्यो भाग जहाँ Shared Resources Access गरिन्छ।

