Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 4 : A binary semaphore may be signaled by a thread other than the one that waited, while a mutex should be released by its owner / बाइनरी सेमाफोर प्रतीक्षा करने वाले के अलावा अन्य थ्रेड भी सिग्नल कर सकता है, जबकि म्यूटेक्स उसके स्वामी को ही छोड़ना चाहिए

Advertisement

Detailed Solution

सही उत्तर A binary semaphore may be signaled by a thread other than the one that waited, while a mutex should be released by its owner / बाइनरी सेमाफोर प्रतीक्षा करने वाले के अलावा अन्य थ्रेड भी सिग्नल कर सकता है, जबकि म्यूटेक्स उसके स्वामी को ही छोड़ना चाहिए है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

A multithreaded ticket-booking server protects its seat counter. Which statement about the synchronization primitives is correct? / एक मल्टीथ्रेडेड टिकट-बुकिंग सर्वर अपने सीट काउंटर की रक्षा करता है। सिंक्रोनाइज़ेशन प्रिमिटिव के बारे में कौन सा कथन सही है?

1.
A mutex can be held by several threads at once for faster booking / म्यूटेक्स तेज़ बुकिंग के लिए एक साथ कई थ्रेड रख सकते हैं
2.
A counting semaphore with initial value 1 behaves exactly like a mutex in all cases / प्रारंभिक मान 1 वाला काउंटिंग सेमाफोर सभी स्थितियों में हूबहू म्यूटेक्स जैसा व्यवहार करता है
3.
Only the thread that locked a semaphore may unlock it, just like a mutex / सेमाफोर को भी म्यूटेक्स की तरह केवल लॉक करने वाला थ्रेड ही अनलॉक कर सकता है
4.
A binary semaphore may be signaled by a thread other than the one that waited, while a mutex should be released by its owner / बाइनरी सेमाफोर प्रतीक्षा करने वाले के अलावा अन्य थ्रेड भी सिग्नल कर सकता है, जबकि म्यूटेक्स उसके स्वामी को ही छोड़ना चाहिए

Correct Answer: A binary semaphore may be signaled by a thread other than the one that waited, while a mutex should be released by its owner / बाइनरी सेमाफोर प्रतीक्षा करने वाले के अलावा अन्य थ्रेड भी सिग्नल कर सकता है, जबकि म्यूटेक्स उसके स्वामी को ही छोड़ना चाहिए

Semaphores have no ownership rule, so any thread can signal one, whereas a mutex is conceptually owned by the locking thread and must be unlocked by that same thread. / सेमाफोर में स्वामित्व नियम नहीं होता, इसलिए कोई भी थ्रेड उसे सिग्नल कर सकता है, जबकि म्यूटेक्स लॉक करने वाले थ्रेड के स्वामित्व में होता है और उसी थ्रेड को अनलॉक करना चाहिए।

Downloaded from PrepSnap (prepsnap.in)