Sunday 11 March 2012

Bakery Algorithm


Critical section for n processes
  • Before entering its critical section, process receives a number. Holder of the smallest number enters the critical section.
  • If processes Pi and Pj receive the same number, if i < j, then Pi is served first; else Pj is served first.
  • The numbering scheme always generates numbers in increasing order of enumeration; i.e., 1,2,3,3,3,3,4,5...

No comments:

Post a Comment