Synchronization Semaphores

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1












The semaphores used for mutual exclusion which are binary semaphore contain 1 as an initial value. When a process attempts to enter into critical region, that process causes the operating system to call wait() function. This function checks the semaphore value. If the value is equal to 1, that semaphore is allowed to enter into the critical region, and the value is decremented by one. If the value is equal to 0, that semaphore is added to waiting queue.



This is actually what the wait() method does on a binary semaphore. On the other hand, when I search for why the value of synchronization semaphores is equal to 0, or what happens if wait() and signal() methods are called on the synchronization semaphores, I cannot find any valid knowledge.



Is there anyone who know the reason why value of synchronization semaphores is equal to 0, and what wait() and signal() methods do on synchronization semaphores ?







share|improve this question
























    up vote
    0
    down vote

    favorite
    1












    The semaphores used for mutual exclusion which are binary semaphore contain 1 as an initial value. When a process attempts to enter into critical region, that process causes the operating system to call wait() function. This function checks the semaphore value. If the value is equal to 1, that semaphore is allowed to enter into the critical region, and the value is decremented by one. If the value is equal to 0, that semaphore is added to waiting queue.



    This is actually what the wait() method does on a binary semaphore. On the other hand, when I search for why the value of synchronization semaphores is equal to 0, or what happens if wait() and signal() methods are called on the synchronization semaphores, I cannot find any valid knowledge.



    Is there anyone who know the reason why value of synchronization semaphores is equal to 0, and what wait() and signal() methods do on synchronization semaphores ?







    share|improve this question






















      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      The semaphores used for mutual exclusion which are binary semaphore contain 1 as an initial value. When a process attempts to enter into critical region, that process causes the operating system to call wait() function. This function checks the semaphore value. If the value is equal to 1, that semaphore is allowed to enter into the critical region, and the value is decremented by one. If the value is equal to 0, that semaphore is added to waiting queue.



      This is actually what the wait() method does on a binary semaphore. On the other hand, when I search for why the value of synchronization semaphores is equal to 0, or what happens if wait() and signal() methods are called on the synchronization semaphores, I cannot find any valid knowledge.



      Is there anyone who know the reason why value of synchronization semaphores is equal to 0, and what wait() and signal() methods do on synchronization semaphores ?







      share|improve this question












      The semaphores used for mutual exclusion which are binary semaphore contain 1 as an initial value. When a process attempts to enter into critical region, that process causes the operating system to call wait() function. This function checks the semaphore value. If the value is equal to 1, that semaphore is allowed to enter into the critical region, and the value is decremented by one. If the value is equal to 0, that semaphore is added to waiting queue.



      This is actually what the wait() method does on a binary semaphore. On the other hand, when I search for why the value of synchronization semaphores is equal to 0, or what happens if wait() and signal() methods are called on the synchronization semaphores, I cannot find any valid knowledge.



      Is there anyone who know the reason why value of synchronization semaphores is equal to 0, and what wait() and signal() methods do on synchronization semaphores ?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 11 at 17:48









      Goktug

      1467




      1467

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f437100%2fsynchronization-semaphores%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f437100%2fsynchronization-semaphores%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)