Here when Pi ,where i=1,2,.....,9 so
in this code P means down operation and V means up operation , initially mutex value=1; now for a down operation it will be decreased by 1 which will be 0 now it will check the value is < 0 or > 0 we are watching that value is 0 means process can enter in to the CS. (HERE P1 IS IN C.S) other processes will come in order to enter into the CS but they again decrease the value by 1 which means the value will be less than 0, so all the process p2,p3,p4,p5,p6,p7,p8,p9 will be blocked. and stored in a queue.
forever p10, will execute it will perform V means UP operation so it will increase the value by 1, and because of this one process will come outfrom the queue from(p2 to p9 any process can come here we are using queue so it will come in FIFO order) again UP again one process come out this will continue...... so in last all the processes in the C.S