Bakery Algorithm Analysis: Critical Section Problem And Solutions

951 Words2 Pages

Critical section problem and solutions ADVISOR: Sir Tanweer Arshad Presentation By: Abiha Ayub 2013-CE-63 December 23,2015 CRITICAL SECTION PROBLEM AND SOLUTIONS Critical Section: The section of code that requires exclusive access to a shared resourse to ensure correct operation. Critical Section Problem: The critical section problem refers to the problem of how to ensure that at most one process is executing its critical section at a given time. Solutions to Critical Section Problem Three solutions to the critical section problem …show more content…

When a process that has exited the critical section re enters, it will give away the turn. If other process is waiting already then it will be the next one to proceed.  This algorithm satisfies all three requirements for solution to critical section problem.So this is the correct solution to critical section problem. N-Process Critical Section Problem Now consider a system of n processes (Po, P1 …… Pn-1). Many solutions are available to solve the N-process critical section problem.we consider Bakery algorithm here. Lamports’s Bakery Algorithm Each process in the Bakery Algorithm has an id.These ids are ordered.Before entering in its CS,each process receives a number.The process holding smallest number entera its critical section.If there exists a tie between two processes i.e. process i and j holds the same number and i< (number[i],i))); } Critical section number[i]=0; Remainder section } while(1);  Peterson’s algorithm is also extended to be used as a solution to N-process critical section problem Other solutions related to critical section problem  Dekker's Algorithm(For solving mutual exclusion problem)  Hyman Mutual Exclusion "Solution"  Eisenburg and McGuire algorithm  Szymanskis’s algorithm 

More about Bakery Algorithm Analysis: Critical Section Problem And Solutions

Open Document