User mode और Kernel mode के बीच switch होने में लगने वाला समय, दो processes के बीच switch होने में लगने वाले समय से ______ होता है।
(KVS PGT C.S. 2018)
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 होने में लगने वाले समय से कम होता है।
A semaphore एक integer variable है जिसे initialization के अलावा केवल निम्न में से किस standard atomic operation के द्वारा access किया जाता है?
(DSSSB TGT C.S. 07.02.2024 (Shift-II))
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 हो जाता है।
Deadlock Prevention की निम्न में से किस condition में कम-से-कम एक resource non-sharable होना चाहिए?
(DSSSB TGT C.S. 07.02.2024 (Shift-II))
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 नहीं होता।
______ में, एक thread तुरंत target thread को terminate कर देता है।
(DSSSB PGT C.S. (Male) 27.07.2018 (Shift-II))
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 का इंतजार किए।
मान लीजिए किसी system में resource R की 10 units हैं और तीन processes X, Y और Z हैं। इनके maximum resource requirement और current allocation दिए गए हैं। अब निम्न resource requests पर विचार कीजिए: (i) X 2 units माँगता है (ii) Y 2 units माँगता है (iii) Z 2 units माँगता है। System को safe state में रखने के लिए इनमें से किस request को grant करना चाहिए?
(DSSSB PGT C.S. (Male) 27.07.2018 (Shift-II))
Correct Answer: C
Explanation (EN): Initial need is X=4, Y=6, Z=2 and available resources are 2. If X or Y is granted 2 units, available becomes 0 and no process can finish, so the state becomes unsafe. If Z is granted 2 units, Z's need becomes 0, so it can finish and release 5 units. Then X and Y can also finish. Hence only request (iii) keeps the system safe.
Explanation (HI): प्रारम्भिक need X=4, Y=6, Z=2 है और available resources 2 हैं। यदि X या Y को 2 units दे दी जाएँ, तो available 0 हो जाएगा और कोई process finish नहीं कर पाएगा, इसलिए state unsafe हो जाएगी। यदि Z को 2 units दी जाएँ, तो उसकी need 0 हो जाएगी और वह finish करके 5 units release कर देगा। उसके बाद X और Y भी finish कर सकते हैं। इसलिए केवल request (iii) सुरक्षित है।
मान लें 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))
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 नहीं है।
Critical section problem के समाधान के लिए निम्न में से कौन-सी condition आवश्यक नहीं है?
(UGC NET C.S. December-2014 (Paper-II))
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 मान्य नहीं है।
चार processes और दो resources (प्रत्येक की दो units) के लिए दिया गया resource allocation graph क्या दर्शाता है?
(KVS PGT C.S. 2018)
Correct Answer: D
Explanation (EN): In the given resource-allocation graph there is a cycle P1 → R1 → P3 → R2 → P1. Since each resource type has multiple instances, the presence of a cycle does not necessarily imply deadlock. Hence it indicates a cycle but no deadlock.
Explanation (HI): दिए गए resource-allocation graph में cycle P1 → R1 → P3 → R2 → P1 उपस्थित है। क्योंकि resource types की multiple instances हैं, इसलिए cycle होने से deadlock आवश्यक नहीं है। अतः यह cycle but no deadlock दर्शाता है।
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))
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 हों।
Threads में degree of concurrency को किस क्रम में व्यवस्थित किया जा सकता है?
(UGC NET C.S. December-2022)
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 है।