Semaphores ?
Semaphore एक synchronisation tool या method होता है | जो की एक integer variable होता है | और इस variable का प्रयोग critical section problem को solved करने मे किया जाता है | integer variable मे जो value होगी उसे mutual exclusive द्वारा बहुत सारे अलग अलग प्रोसेस को उपयोग करके को synchronization achive करेंगे |.
critical section problem को Solve करने के लिए दो (2) atomic operations का प्रयोग किया जाता है |
- wait () operation :- value को decrements करता है
wait(S) { while (S<=0); S--; }
2. signal () operation :- value को increments करता है
signal(S) { S++; }
Types of semaphores :- semaphores दो प्रकार की होती है
- Binary Semaphores :- इसमें binary ( 0 and 1) वैल्यू होती है |
- Counting Semaphores :- इसमें non – negative integer वैल्यू होती है |
Thank you for these notes..
welcome bhai