Sunday 11 March 2012

Semaphore as a General Synchronization Tool


  • Execute B in Pj only after A executed in Pi
  • Use semaphore flag initialized to 0
  • Code:
                      Pi                 Pj
                      M                     
                     A              wait(flag)
              signal(flag)         B

No comments:

Post a Comment