in Operating System
787 views
1 vote
1 vote
State True/False

    Bakery algorithm ensures that no process is starved.

1.  True

2.  False
in Operating System
787 views

3 Answers

0 votes
0 votes

True , Lamport Bakery Algorithm satisfies deadlock free  and starvation . We know that in Bakery Algorithm Each process is given a ticket number say (i). Now all those process which have ticket number less than i will enter and exit CS ,but for process with ticket number >i  cant enter in CS because process with ticket =i is not yet enter .

And if you think process with ticket > i can enter CS, then its not possible because of the below statement

(the concept of bakery algorithm)

∀j:j!=i:Num[j] = 0∨(NUM[j], IDj)≥(NUM[i] ,IDi)

This question has been asked indirectly In gate2016 OS . However you can refer to below video where they have explained the approach for it

http://web.cs.iastate.edu/~chaudhur/cs611/Sp09/notes/lec03.pdf

https://www.youtube.com/watch?v=3pUScfud9Sg

1 comment

Yes it would be deadlock free and starved ftee
0
0
0 votes
0 votes

True

The Bakery Algorithm is a mutual exclusion algorithm used to solve the critical section problem in concurrent programming. It ensures that no process is starved, meaning that every process will eventually enter its critical section if it requests it. The algorithm assigns a unique number to each process as they enter the bakery, and processes with lower numbers get priority. This prevents indefinite postponement (starvation) of any process.

0 votes
0 votes

True

The Bakery algorithm is a mutual exclusion algorithm used in concurrent programming to ensure that multiple processes can safely access shared resources without violating mutual exclusion. One of the properties of the Bakery algorithm is that it guarantees that no process will be starved, meaning that every process eventually gets a chance to enter the critical section.

The algorithm assigns a unique "ticket" to each process in a way that preserves the order of request. This ticket order ensures fairness, as processes with lower ticket numbers get priority. Starvation is prevented because even if a process receives a high ticket number, it is guaranteed that eventually, all processes with lower ticket numbers will complete their critical sections and reset their tickets, allowing the high-ticket process to proceed.

So, the statement is True: The Bakery algorithm ensures that no process is starved.