Question
Option 4 : P1, P3, P4, P0, P2 / P1, P3, P4, P0, P2
Detailed Solution
सही उत्तर P1, P3, P4, P0, P2 / P1, P3, P4, P0, P2 है।
Question:
A system has 5 processes P0-P4 and 3 resource types with total instances (10, 5, 7). The allocation matrix rows are P0: (0,1,0), P1: (2,0,0), P2: (3,0,2), P3: (2,1,1), P4: (0,0,2); the maximum matrix rows are P0: (7,5,3), P1: (3,2,2), P2: (9,0,2), P3: (2,2,2), P4: (4,3,3); and the available vector is (3,3,2). Using Banker's algorithm, which of the following is a safe sequence? / एक तंत्र में 5 प्रक्रियाएँ P0-P4 और 3 संसाधन प्रकार हैं जिनके कुल उदाहरण (10, 5, 7) हैं। आवंटन मैट्रिक्स की पंक्तियाँ P0: (0,1,0), P1: (2,0,0), P2: (3,0,2), P3: (2,1,1), P4: (0,0,2) हैं; अधिकतम मैट्रिक्स की पंक्तियाँ P0: (7,5,3), P1: (3,2,2), P2: (9,0,2), P3: (2,2,2), P4: (4,3,3) हैं; तथा उपलब्ध वेक्टर (3,3,2) है। बैंकर एल्गोरिथ्म का उपयोग करते हुए निम्न में से कौन-सा सुरक्षित अनुक्रम है?
Correct Answer: P1, P3, P4, P0, P2 / P1, P3, P4, P0, P2
Need = Max - Allocation gives P0: (7,4,3), P1: (1,2,2), P2: (6,0,0), P3: (0,1,1), P4: (4,3,1). With available (3,3,2): P1's need (1,2,2) is satisfiable, releasing (5,3,2); then P3 (0,1,1) gives (7,4,3); then P4 (4,3,1) gives (7,4,5); then P0 (7,4,3) gives (7,5,5); then P2 (6,0,0) — all finish. Hence P1, P3, P4, P0, P2 is a safe sequence; the other orders fail (e.g. P0 needs (7,4,3), which exceeds available (3,3,2)). / नीड = अधिकतम - आवंटन से P0: (7,4,3), P1: (1,2,2), P2: (6,0,0), P3: (0,1,1), P4: (4,3,1)। उपलब्ध (3,3,2) से: P1 की आवश्यकता पूरी होती है → (5,3,2); फिर P3 → (7,4,3); फिर P4 → (7,4,5); फिर P0 → (7,5,5); फिर P2 → सभी पूर्ण। अतः P1, P3, P4, P0, P2 सुरक्षित अनुक्रम है।