पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 20 के उत्तर और हल FliQi Question Bank app में।
भाषा
प्रश्न 1उत्तर + हल
execution शुरू होने से पहले process को उसके सारे resources दे देने का नुकसान ____ है।
The disadvantage of a process being allocated all its resources before beginning its execution is ____
ACPU का कम उपयोगLow CPU utilization
Bresources का कम उपयोगLow resource utilization
Cresources का बहुत ज़्यादा उपयोगVery high resource utilization
Dउल्लिखित में से कोई नहींNone of the mentioned
सही उत्तर / Answer: (B)
हल / Solution
hold and wait रोकने का एक तरीका है कि process शुरू होने से पहले अपने सारे resources ले ले। दिक़्क़त यह है कि कई resource लंबे समय तक बेकार पड़े रहते हैं। जैसे process को printer सिर्फ़ आख़िर में चाहिए, पर वह शुरू से उसी के पास रहता है। इसलिए resource utilization कम होता है। starvation भी हो सकती है। CPU utilization यहाँ मुख्य मुद्दा नहीं है, और 'ज़्यादा उपयोग' उलटी बात है।
One way to prevent hold and wait is to give a process all its resources before it starts. The problem is that many resources then sit idle for a long time. For example, a process may need the printer only at the end, yet it holds it from the start. That is why resource utilization becomes low. Starvation is also possible. CPU utilization is not the main issue here, and 'very high utilization' is the opposite.
प्रश्न 2उत्तर + हल
deadlock prevention (गतिरोध निवारण) विधियों का ऐसा समूह है ____
Deadlock prevention is a set of methods ____
Aजो पक्का करता है कि कम से कम एक आवश्यक शर्त लागू न हो सकेto ensure that at least one of the necessary conditions cannot hold
Bजो पक्का करता है कि कोई भी आवश्यक शर्त लागू न हो सकेto ensure that none of the necessary conditions can hold
Cजो तय करता है कि process को माँगे गए resource दिए जाएँ या नहींto decide if the requested resources for a process have to be given or not
Dजो deadlock से उबरने के लिए हैto recover from a deadlock
सही उत्तर / Answer: (A)
हल / Solution
deadlock के लिए चार शर्तें एक साथ चाहिए: mutual exclusion, hold and wait, no preemption और circular wait। prevention का तरीका है इनमें से कम से कम एक शर्त को कभी बनने ही न देना। जैसे सारे resource एक साथ माँगना hold and wait को तोड़ता है। resources को तय क्रम में माँगना circular wait को तोड़ता है। चारों को तोड़ना ज़रूरी नहीं, एक काफ़ी है। request देने या न देने का फ़ैसला avoidance है। उबरना recovery है।
Deadlock needs four conditions together: mutual exclusion, hold and wait, no preemption and circular wait. Prevention makes sure that at least one of them can never hold. For example, requesting all resources at once breaks hold and wait, and requesting resources in a fixed order breaks circular wait. Breaking all four is not needed; one is enough. Deciding whether to grant a request is avoidance. Getting out of a deadlock is recovery.
प्रश्न 3उत्तर + हल
deadlock होने के लिए निम्नलिखित में से कौन-सी शर्तें एक साथ लागू होनी चाहिए?
For a deadlock to arise, which of the following conditions must hold simultaneously?
Cपकड़ो और प्रतीक्षा करो (hold and wait)Hold and wait
Dउल्लिखित सभीAll of the mentioned
सही उत्तर / Answer: (D)
हल / Solution
Coffman के अनुसार deadlock के लिए चार शर्तें एक साथ होनी चाहिए। mutual exclusion यानी resource एक समय में एक ही process ले सकती है। hold and wait यानी process एक resource पकड़कर दूसरे का इंतज़ार करती है। no preemption यानी दिया गया resource ज़बरदस्ती वापस नहीं लिया जा सकता। circular wait यानी processes गोल घेरे में एक-दूसरे का इंतज़ार करती हैं। दिए गए तीनों इसी सूची में हैं, इसलिए 'उल्लिखित सभी' सही है।
Coffman listed four conditions that must hold together for deadlock. Mutual exclusion: a resource can be used by only one process at a time. Hold and wait: a process holds one resource while waiting for another. No preemption: a resource cannot be taken back by force. Circular wait: processes wait for each other in a circle. All three given options are from this list, so 'All of the mentioned' is correct. Any single option alone is incomplete.
प्रश्न 4उत्तर + हल
deadlock के मामले में मल्टीथ्रेडेड प्रोग्राम कैसे होते हैं?
What are multithreaded programs?
Adeadlock की संभावना कम होती हैLesser prone to deadlocks
Bdeadlock की संभावना ज़्यादा होती हैMore prone to deadlocks
Cdeadlock की बिल्कुल संभावना नहीं होतीNot at all prone to deadlocks
Dउल्लिखित में से कोई नहींNone of the mentioned
सही उत्तर / Answer: (B)
हल / Solution
मल्टीथ्रेडेड प्रोग्राम में कई threads एक साथ चलते हैं और साझा data पर lock (mutex) लगाते हैं। मान लीजिए thread A ने lock L1 पकड़ा है और L2 माँग रहा है। उसी समय thread B ने L2 पकड़ा है और L1 माँग रहा है। अब दोनों हमेशा के लिए रुक जाएँगे। lock जितने ज़्यादा, ऐसे घेरे की संभावना उतनी ज़्यादा। इसलिए ये deadlock के प्रति ज़्यादा संवेदनशील होते हैं। 'कम' या 'बिल्कुल नहीं' ग़लत है।
In a multithreaded program, many threads run at the same time and lock shared data with mutexes. Suppose thread A holds lock L1 and waits for L2, while thread B holds L2 and waits for L1. Both will wait forever. The more locks there are, the higher the chance of such a circle. So multithreaded programs are more prone to deadlocks. 'Less prone' and 'not at all prone' are both wrong.
प्रश्न 5उत्तर + हल
resources का अनुरोध (request) और उन्हें छोड़ना (release) ____ होते हैं।
The request and release of resources are ____
Aकमांड लाइन स्टेटमेंटCommand line statements
Bइंटरप्ट (interrupts)Interrupts
Cसिस्टम कॉल (system calls)System calls
Dविशेष प्रोग्रामSpecial programs
सही उत्तर / Answer: (C)
हल / Solution
process सीधे hardware या resource नहीं छू सकती। उसे OS से माँगना पड़ता है, और यह माँग system call से होती है। जैसे device के लिए request() और release(), file के लिए open() और close(), memory के लिए allocate() और free()। semaphore पर wait() और signal() भी इसी तरह चलते हैं। command line statement user के आदेश हैं। interrupt hardware का संकेत है जो CPU का ध्यान खींचता है। विशेष प्रोग्राम कोई मानक तरीका नहीं है।
A process cannot touch hardware or resources directly. It has to ask the OS, and it does this through system calls. Examples are request() and release() for devices, open() and close() for files, and allocate() and free() for memory. The wait() and signal() operations on semaphores work the same way. Command line statements are user commands. An interrupt is a hardware signal that grabs the CPU's attention. Special programs are not a standard mechanism.
प्रश्न 6उत्तर + हल
किसी process द्वारा माँगे गए resources की संख्या ____
The number of resources requested by a process ____
Asystem में उपलब्ध कुल resources से हमेशा कम होनी चाहिएmust always be less than the total number of resources available in the system
Bहमेशा system में उपलब्ध कुल resources के बराबर होनी चाहिएmust always be equal to the total number of resources available in the system
Csystem में उपलब्ध कुल resources से ज़्यादा नहीं होनी चाहिएmust not exceed the total number of resources available in the system
Dsystem में उपलब्ध कुल resources से ज़्यादा होनी चाहिएmust exceed the total number of resources available in the system
सही उत्तर / Answer: (C)
हल / Solution
कोई process उतने ही resource माँग सकती है जितने system में कुल मौजूद हैं। मान लीजिए system में 5 printer हैं। तब process 5 तक माँग सकती है, 6 नहीं, क्योंकि 6 की माँग कभी पूरी नहीं हो सकती। इसलिए माँग कुल से ज़्यादा नहीं होनी चाहिए। 'हमेशा कम' ग़लत है, क्योंकि पूरे 5 माँगना भी जायज़ है। 'हमेशा बराबर' ज़रूरी नहीं है। 'ज़्यादा होनी चाहिए' तो उलटी बात है।
A process may request at most as many resources as the system actually has. Suppose the system has 5 printers. A process may ask for up to 5, but not 6, because a request for 6 can never be met. So the request must not exceed the total. 'Always less' is wrong, since asking for all 5 is allowed. 'Always equal' is not required. 'Must exceed' says the exact opposite of the rule.
प्रश्न 7उत्तर + हल
deadlock से बचने के लिए ____
To avoid deadlock ____
Aआवंटन के लिए resources की संख्या तय (fixed) होनी चाहिएthere must be a fixed number of resources to allocate
Bresource आवंटन सिर्फ़ एक बार होना चाहिएresource allocation must be done only once
Cdeadlock में फँसी सभी processes को abort करना चाहिएall deadlocked processes must be aborted
Dinversion तकनीक इस्तेमाल की जा सकती हैinversion technique can be used
सही उत्तर / Answer: (A)
हल / Solution
deadlock avoidance में OS हर request पर पहले जाँचता है कि resource देने से system unsafe state में तो नहीं जाएगा। बैंकर्स एल्गोरिदम यही करता है। यह जाँच तभी हो सकती है जब हर प्रकार के resources की कुल संख्या तय हो और पहले से पता हो। resource सिर्फ़ एक बार देना ज़रूरी शर्त नहीं है। सभी deadlocked processes को abort करना recovery है, बचाव नहीं। inversion तकनीक का deadlock से बचने से कोई संबंध नहीं है।
In deadlock avoidance, the OS checks every request before granting it, to make sure the system does not enter an unsafe state. Banker's algorithm works this way. This check is possible only when the total number of each resource type is fixed and known in advance. Allocating resources only once is not a required condition. Aborting all deadlocked processes is recovery, not avoidance. Inversion has nothing to do with avoiding deadlock.
प्रश्न 8उत्तर + हल
deadlock होने का पता लगाने का दृश्य (गणितीय) तरीका निम्नलिखित में से कौन-सा है?
Which one of the following is a visual (mathematical) way to determine the deadlock occurrence?
resource allocation graph (RAG) में processes को गोले और resources को आयत से दिखाते हैं। request edge process से resource की ओर जाता है। assignment edge resource से process की ओर जाता है। अगर graph में कोई cycle नहीं है, तो deadlock नहीं है। हर resource का एक ही instance हो और cycle बने, तो deadlock पक्का है। कई instance हों तो cycle सिर्फ़ संभावना बताती है। starvation graph और inversion graph नाम का कोई मानक तरीका नहीं है।
In a resource allocation graph (RAG), processes are drawn as circles and resources as rectangles. A request edge goes from a process to a resource, and an assignment edge goes from a resource to a process. If the graph has no cycle, there is no deadlock. If every resource has a single instance, a cycle means deadlock for sure. With several instances, a cycle only shows that deadlock is possible. Starvation graph and inversion graph are not standard tools.
प्रश्न 9उत्तर + हल
मल्टीटास्किंग में जब किसी process को ज़रूरी resource लगातार नहीं मिलते, तो इस समस्या को ____ कहते हैं।
A problem encountered in multitasking when a process is perpetually denied necessary resources is called ____.
Aगतिरोध (deadlock)Deadlock
Bभुखमरी (starvation)Starvation
Cव्युत्क्रमण (inversion)Inversion
Dएजिंग (aging)Aging
सही उत्तर / Answer: (B)
हल / Solution
starvation में process चल सकने लायक होती है, पर उसकी बारी बार-बार टलती रहती है। जैसे priority scheduling में ऊँची priority वाली processes आती रहें, तो नीची priority वाली को CPU मिलता ही नहीं। deadlock अलग है। उसमें processes एक-दूसरे के पकड़े resource के लिए गोल घेरे में रुकी रहती हैं। priority inversion में ऊँची priority वाली process नीची वाली के कारण रुकती है। aging तो starvation का इलाज है, जिसमें इंतज़ार के साथ priority बढ़ाई जाती है।
In starvation, a process is ready to run, but its turn keeps getting postponed. For example, in priority scheduling, if high-priority processes keep arriving, a low-priority process may never get the CPU. Deadlock is different: processes wait in a circle for resources held by each other, and none can move. Priority inversion means a high-priority process waits because of a lower-priority one. Aging is the cure for starvation, since it raises priority as waiting time grows.
प्रश्न 10उत्तर + हल
बैंकर्स एल्गोरिदम की कमी क्या है?
What is the drawback of Banker's algorithm?
Aprocess को पहले से शायद ही पता होता है कि उसे कितने resource चाहिए होंगेIn advance, processes rarely know how many resources they will need
Bसमय के साथ processes की संख्या बदलती रहती हैThe number of processes changes as time progresses
Cजो resource अभी उपलब्ध है, वह बाद में हट सकता हैA resource that was available can disappear
Dउल्लिखित सभीAll of the mentioned
सही उत्तर / Answer: (D)
हल / Solution
बैंकर्स एल्गोरिदम तीन बातें पहले से मानकर चलता है। पहली, हर process अपनी अधिकतम ज़रूरत पहले बता दे, पर असल में process को यह शायद ही पता होता है। दूसरी, processes की संख्या तय रहे, पर असली system में processes आती-जाती रहती हैं। तीसरी, कुल resource तय रहें, पर कोई device ख़राब होकर हट भी सकता है। तीनों विकल्प एक-एक कमी बताते हैं। इसलिए 'उल्लिखित सभी' सही उत्तर है।
Banker's algorithm depends on three assumptions. First, every process must declare its maximum need in advance, but processes rarely know this. Second, the number of processes should stay fixed, but in a real system processes keep arriving and leaving. Third, the total resources should stay fixed, but a device can fail and disappear. Each option describes one of these problems, so none of them alone is the full answer. That is why 'All of the mentioned' is correct.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
एक सिस्टम सुरक्षित (safe) स्थिति में तब होता है जब ......
A system is in the safe state if ______.
Aसिस्टम किसी न किसी क्रम में हर प्रोसेस को संसाधन देकर भी गतिरोध से बच सकेThe system can allocate resources to each process in some order and still avoid a deadlock
Bसिस्टम के पास इस समय एक भी मुक्त संसाधन न बचा होThe system has no free resource left at present
गतिरोध (deadlock) के संभव होने के लिए निम्नलिखित में से कौन-सी शर्त आवश्यक है?
Which of the following conditions is required for a deadlock to be possible?
Aपारस्परिक बहिष्करणMutual exclusion
Bप्रोसेस दूसरे संसाधनों की प्रतीक्षा करते हुए आवंटित संसाधन अपने पास रख सकती हैA process may hold allocated resources while awaiting assignment of other resources
Cकिसी प्रोसेस से संसाधन जबरन नहीं हटाया जा सकताNo resource can be forcibly removed from a process holding it
......... स्थिति में दो या अधिक प्रोसेस एक वृत्ताकार शृंखला बना लेती हैं, जिसमें हर प्रोसेस उस संसाधन की प्रतीक्षा करती है जो शृंखला के अगले सदस्य के पास है।
In the ......... condition, two or more processes form a circular chain in which each process is waiting for a resource that is held by the next member of the chain.