Question:
Which of the following is a synchronization tool?
निम्न में से कौन सा एक सिंंक्रनाइज़ेेशन टूल है?
Options:
- Thread
- Pipe
- Semaphore
- Socket
- थ्रेेड
- पाइप
- सेमाफोर
- सॉकेट
Correct Answer: c)
Explanation:
Detailed Explanation:
The correct answer is c) Semaphore (सेमाफोर).
Process Synchronization Tools:
- Semaphore: Introduced by Edsger Dijkstra in 1965, a semaphore is a fundamental synchronization tool and abstract data type used to coordinate access to shared resources and solve critical section problems among concurrent processes.
- It maintains an integer value accessed exclusively via two atomic operations:
wait()(or $P$): Decrements the counter; if negative, blocks the process.signal()(or $V$): Increments the counter and unblocks a waiting process.
- Types: Binary Semaphore (Mutex) (values 0 or 1 for mutual exclusion) and Counting Semaphore (controls access to a finite pool of resources).
- Threads are execution units; pipes and sockets are Inter-Process Communication (IPC) data transfer channels.
विस्तृत व्याख्या:
सही उत्तर c) सेमाफोर है।
प्रोसेस सिंक्रोनाइज़ेशन उपकरण:
- सेमाफोर (Semaphore): 1965 में एड्सगर डिज्क्स्ट्रा द्वारा प्रस्तावित, सेमाफोर एक मूलभूत सिंक्रोनाइज़ेशन टूल है जिसका उपयोग समवर्ती (concurrent) प्रोसेसों के बीच क्रिटिकल सेक्शन समस्या को हल करने और रेस कंडीशन (race conditions) से बचने के लिए किया जाता है।
- यह एक पूर्णांक चर (integer variable) होता है जिसे केवल दो एटॉमिक ऑपरेशनों:
wait()(या P) औरsignal()(या V) के माध्यम से नियंत्रित किया जाता है। - थ्रेड निष्पादन की इकाई है; पाइप और सॉकेट संचार (IPC) माध्यम हैं।