Operating System

11. Which of the following will be used for a system having multiple instances of a resource type?
निम्न में से किसका उपयोग उस system में किया जाता है जिसमें किसी resource type की multiple instances हों?
(DSSSB PGT C.S. (Male) 27.07.2018 (Shift-II))
A. Resource-allocation graph
B. Banker's algorithm
C. Wait-for graph
D. Semaphores

Correct Answer: B

Explanation (EN): Banker's algorithm is a deadlock avoidance algorithm. It is used when there are multiple instances of a resource in a system.

Explanation (HI): Banker's algorithm एक deadlock avoidance algorithm है। इसका उपयोग तब किया जाता है जब system में किसी resource की multiple instances हों।

12. In context of database transactions, a 'wait-for graph' is used for:
Database transactions के संदर्भ में 'wait-for graph' का उपयोग किसलिए किया जाता है?
(RPSC C.S. 2016 (Paper-II))
A. Concurrency control
B. Dead lock prevention
C. Recovery
D. Dead lock detection

Correct Answer: D

Explanation (EN): A wait-for graph is used to detect deadlock. If the graph contains a cycle, then there is a deadlock.

Explanation (HI): Wait-for graph का उपयोग deadlock detect करने के लिए किया जाता है। यदि graph में cycle हो, तो deadlock मौजूद है।

13. The resource matrix is a data structure used in deadlock detection algorithms to:
Resource matrix deadlock detection algorithms में किसको represent करने के लिए उपयोग की जाने वाली data structure है?
(Bihar STET C.S. 12.09.2023 (Shift-II))
A. Represent resource allocation
B. Represent the execution order of processes
C. Represent the execution history of processes
D. Represent the priority of processes

Correct Answer: A

Explanation (EN): A resource matrix is used in deadlock detection algorithms to represent which resources are allocated to which processes.

Explanation (HI): Resource matrix का उपयोग यह दिखाने के लिए किया जाता है कि कौन-से resources किस process को allocate किए गए हैं।

14. A computer has six tape drives with n processes competing for them. Each process may need two drives. What is the maximum value of n for the system to be deadlock free?
एक computer में 6 tape drives हैं और n processes उनके लिए compete कर रही हैं। प्रत्येक process को 2 drives की आवश्यकता हो सकती है। System deadlock free रहे, इसके लिए n का maximum value क्या होगा?
(UGC NET C.S. Exam-24 June-2019 (Paper-II))
A. 5
B. 4
C. 3
D. 6

Correct Answer: A

Explanation (EN): If 6 processes each hold 1 tape drive and wait for another, deadlock can occur. To guarantee deadlock freedom, the maximum number of processes is 5.

Explanation (HI): यदि 6 processes में से प्रत्येक 1 tape drive ले ले और दूसरी का इंतजार करे, तो deadlock हो सकता है। Deadlock freedom सुनिश्चित करने के लिए n का अधिकतम मान 5 होगा।

15. The Banker's algorithm is an example of a deadlock:
Banker's algorithm deadlock के किस प्रकार का उदाहरण है?
(Bihar STET C.S. 12.09.2023 (Shift-II))
A. Avoidance algorithm
B. Detection algorithm
C. Prevention algorithm
D. Termination algorithm

Correct Answer: A

Explanation (EN): Banker's Algorithm checks whether the system remains in a safe state before allocating resources. Thus it avoids deadlock.

Explanation (HI): Banker's Algorithm resources allocate करने से पहले जाँचता है कि system safe state में रहेगा या नहीं। इसलिए यह deadlock avoidance algorithm है।

16. A thread is also called:
Thread को और किस नाम से जाना जाता है?
(KVS PGT C.S. 2017)
A. A scheduler
B. A virtual process
C. A heavyweight process
D. A lightweight process

Correct Answer: D

Explanation (EN): A thread is also known as a lightweight process. It is a path of execution within a process.

Explanation (HI): Thread को lightweight process भी कहा जाता है। यह किसी process के अंदर execution का एक path होता है।

17. Which one of the following statements are CORRECT? (A) Granularity is the size of data item in a database. (B) Two operations in a schedule are said to be conflict if they belong to same transaction. (C) Two schedulers are said to be conflict equivalent if the order of any two conflicting operations is the same in both schedules. (D) Write operations which are performed without performing the write operation are known as Blind Writes. Choose the correct answer from the options given below.
निम्न में से कौन-से statements सही हैं? (A) Granularity database में data item के size को दर्शाता है। (B) किसी schedule में दो operations conflict कहलाते हैं यदि वे same transaction से संबंधित हों। (C) दो schedulers conflict equivalent कहलाते हैं यदि किसी भी दो conflicting operations का क्रम दोनों schedules में समान हो। (D) जो write operations बिना write operation किए किए जाते हैं उन्हें Blind Writes कहते हैं। सही उत्तर चुनिए।
(UGC NET C.S. December-2023)
A. (A) and (B) Only
B. (A), (B) and (C) Only
C. (A), (B) and (D) Only
D. (B) and (C) Only

Correct Answer: B

Explanation (EN): As per the given key, statements (A), (B), and (C) are correct and statement (D) is incorrect.

Explanation (HI): दिए गए उत्तर के अनुसार statements (A), (B) और (C) सही हैं तथा statement (D) गलत है।

18. Which one of these is not a condition for Resource Deadlock?
निम्न में से कौन-सी Resource Deadlock की condition नहीं है?
(DSSSB PGT C.S. M/F 11.07.2021)
A. Non-sharable resources
B. Hold-and-wait
C. Preemption
D. Circular waits

Correct Answer: C

Explanation (EN): The necessary conditions for deadlock are mutual exclusion, hold and wait, no preemption, and circular wait. Therefore preemption itself is not a deadlock condition.

Explanation (HI): Deadlock की आवश्यक conditions हैं: mutual exclusion, hold and wait, no preemption, और circular wait। इसलिए preemption स्वयं deadlock condition नहीं है।

19. Which of the following statement(s) is/are true regarding threads in operating system? I. The threads in a process are visible to other processes. II. A thread is strictly private resource of a process.
Operating system में threads के संबंध में निम्न कथनों में से कौन-सा/से सही है/हैं? I. किसी process के threads अन्य processes को दिखाई देते हैं। II. Thread किसी process का strictly private resource होता है।
(DSSSB TGT C.S. 08.08.2021 (Shift-I))
A. Only I
B. Only II
C. Both I and II
D. Neither I nor II

Correct Answer: B

Explanation (EN): Statement I is false because threads of one process are not directly visible or accessible to other independent processes. Statement II is true because threads belong exclusively to the process that created them.

Explanation (HI): Statement I गलत है क्योंकि एक process के threads दूसरे independent processes को सीधे दिखाई नहीं देते या उनके द्वारा नियंत्रित नहीं किए जा सकते। Statement II सही है क्योंकि thread उसी process का private resource होता है जिसने उसे बनाया है।

20. Which of the following statement(s) is/are true regarding processes and threads in operating system? I. Threads encapsulates concurrency within a process. II. Process encapsulates protection within the system.
Operating system में processes और threads के संबंध में निम्न कथनों में से कौन-सा/से सही है/हैं? I. Threads किसी process के भीतर concurrency को encapsulate करते हैं। II. Process system के भीतर protection को encapsulate करता है।
(DSSSB TGT C.S. 08.08.2021 (Shift-I))
A. Only I
B. Only II
C. Both I and II
D. Neither I nor II

Correct Answer: C

Explanation (EN): Threads enable concurrency within a process, and processes provide protection through isolated address spaces. Therefore both statements are true.

Explanation (HI): Threads किसी process के भीतर concurrency उपलब्ध कराते हैं, और process अलग address space देकर protection प्रदान करता है। इसलिए दोनों statements सही हैं।