Operating System

1. Time taken to switch between user and Kernel modes is ______ the time taken to switch between two processes.
User mode और Kernel mode के बीच switch होने में लगने वाला समय, दो processes के बीच switch होने में लगने वाले समय से ______ होता है।
(KVS PGT C.S. 2018)
A. More than
B. Independent of
C. Less than
D. Equal to

Correct Answer: C

Explanation (EN): Time taken to switch between user and kernel modes is less than the time taken to switch between two processes.

Explanation (HI): User mode और Kernel mode के बीच switch होने में लगने वाला समय, दो processes के बीच switch होने में लगने वाले समय से कम होता है।

2. A semaphore is an integer variable that, apart from initialization, is accessed only through which of the following standard atomic operation?
A semaphore एक integer variable है जिसे initialization के अलावा केवल निम्न में से किस standard atomic operation के द्वारा access किया जाता है?
(DSSSB TGT C.S. 07.02.2024 (Shift-II))
A. release()
B. lock()
C. acquire()
D. signal()

Correct Answer: D

Explanation (EN): A semaphore is a synchronization tool used in operating systems to control access to shared resources by multiple processes. It is an integer variable that can only be modified using atomic operations to prevent race conditions. signal() increases the semaphore value. If the result is non-positive, a waiting process is unblocked.

Explanation (HI): Semaphore operating system में shared resources के access को control करने के लिए उपयोग किया जाता है। इसे केवल atomic operations द्वारा modify किया जाता है ताकि race condition न हो। signal() semaphore की value बढ़ाता है। यदि परिणाम non-positive हो, तो waiting process unblock हो जाता है।

3. In which of the following condition of Deadlock Prevention, at least one resource must be non-sharable?
Deadlock Prevention की निम्न में से किस condition में कम-से-कम एक resource non-sharable होना चाहिए?
(DSSSB TGT C.S. 07.02.2024 (Shift-II))
A. Circular wait
B. Hold and wait
C. Mutual Exclusion
D. No preemption

Correct Answer: C

Explanation (EN): Mutual Exclusion means at least one resource must be non-sharable, that is, only one process can use it at a time. Example: a printer. If all resources were sharable, deadlock could not occur.

Explanation (HI): Mutual Exclusion condition में कम-से-कम एक resource non-sharable होना चाहिए, अर्थात एक समय में केवल एक process ही उसका उपयोग कर सकता है। उदाहरण: printer। यदि सभी resources sharable होते, तो deadlock नहीं होता।

4. In ______, one thread immediately terminate the target thread.
______ में, एक thread तुरंत target thread को terminate कर देता है।
(DSSSB PGT C.S. (Male) 27.07.2018 (Shift-II))
A. Asynchronous cancellation
B. Synchronous cancellation
C. Deferred cancellation
D. Both deferred and asynchronous cancellation

Correct Answer: A

Explanation (EN): Thread cancellation is the process of terminating a thread before it finishes execution. In asynchronous cancellation, one thread immediately terminates the target thread without waiting for it to reach a safe point.

Explanation (HI): Thread cancellation का अर्थ है किसी thread को उसके execution पूरा होने से पहले समाप्त करना। Asynchronous cancellation में एक thread target thread को तुरंत terminate कर देता है, बिना safe point का इंतजार किए।

5. Let Pi and Pj be two processes, R be the set of variables read from memory, and W be the set of variables written to memory. For the concurrent execution of two processes Pi and Pj which of the following conditions is not true?
मान लें Pi और Pj दो processes हैं, R memory से read किए गए variables का set है और W memory में written variables का set है। Pi और Pj के concurrent execution के लिए निम्न में से कौन-सी condition true नहीं है?
(UGC NET C.S. June-2015 (Paper-II))
A. R(Pi) ∩ W(Pj) = Φ
B. W(Pi) ∩ R(Pj) = Φ
C. R(Pi) ∩ R(Pj) = Φ
D. W(Pi) ∩ W(Pj) = Φ

Correct Answer: C

Explanation (EN): Reading by two processes does not create any conflict. Therefore R(Pi) ∩ R(Pj) need not be empty, so this condition is not true.

Explanation (HI): दो processes द्वारा केवल reading करने से कोई conflict नहीं होता। इसलिए R(Pi) ∩ R(Pj) का खाली होना आवश्यक नहीं है। अतः यही condition true नहीं है।

6. Which of the following conditions does not hold good for a solution to a critical section problem?
Critical section problem के समाधान के लिए निम्न में से कौन-सी condition आवश्यक नहीं है?
(UGC NET C.S. December-2014 (Paper-II))
A. No assumptions may be made about speeds or the number of CPUs.
B. No two processes may be simultaneously inside their critical sections.
C. Processes running outside its critical section may block other processes.
D. Processes do not wait forever to enter its critical section.

Correct Answer: C

Explanation (EN): In a correct solution to the critical section problem, processes outside the critical section should not block other processes. Hence this condition does not hold good.

Explanation (HI): Critical section problem के सही समाधान में जो process critical section के बाहर है, उसे अन्य processes को block नहीं करना चाहिए। इसलिए यह condition मान्य नहीं है।

7. Consider the following statements about deadlock: A. Existence of a cycle in resource-allocation graph indicates deadlock. B. Existence of a cycle in wait-for graph indicates deadlock. C. Mutual-exclusion, hold and wait, no preemption and circular wait conditions, if occur simultaneously, may lead to deadlock. Mark the correct option:
Deadlock के बारे में निम्न statements पर विचार कीजिए: A. Resource-allocation graph में cycle होना deadlock को दर्शाता है। B. Wait-for graph में cycle होना deadlock को दर्शाता है। C. Mutual exclusion, hold and wait, no preemption और circular wait यदि एक साथ हों, तो deadlock हो सकता है। सही विकल्प चुनिए।
(NVS PGT C.S. 15.12.2022 (Shift-II))
A. Only (B) is correct
B. Only (C) is correct
C. Only (A) and (C) are correct
D. Only (B) and (C) are correct

Correct Answer: D

Explanation (EN): A cycle in a wait-for graph indicates deadlock. Also, if mutual exclusion, hold and wait, no preemption, and circular wait occur simultaneously, deadlock may occur. A cycle in a resource-allocation graph does not always indicate deadlock when there are multiple instances of resources.

Explanation (HI): Wait-for graph में cycle होना deadlock को दर्शाता है। साथ ही mutual exclusion, hold and wait, no preemption और circular wait एक साथ होने पर deadlock हो सकता है। Resource-allocation graph में cycle हमेशा deadlock नहीं दर्शाता, विशेषकर जब resources की multiple instances हों।

8. Degree of concurrency in thread can be arranged in the manner.
Threads में degree of concurrency को किस क्रम में व्यवस्थित किया जा सकता है?
(UGC NET C.S. December-2022)
A. One-to-one > many-to-one > many-to-many
B. One-to-one > many-to-many > many-to-one
C. many-to-many > many-to-one > one-to-one
D. None of the above

Correct Answer: B

Explanation (EN): The correct arrangement of degree of concurrency from highest to lowest is One-to-one > many-to-many > many-to-one.

Explanation (HI): Concurrency की degree का सही क्रम highest से lowest तक One-to-one > many-to-many > many-to-one है।

9. 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 हों।

10. 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 मौजूद है।