The psuedocode of Lamport’s bakery algorithm is given below. Fully explain one example of how it can be “unfair”. boolean[n] choosing;int[n] ticket;startThreads();Txvoid main() { int x = threadNumber; while (!done) { choosing[x] = true; ticket[x] = maxValue(ticket) + 1; choosing[x] = false; for (int i = 0; i < n; i++) { if (i == x) continue; while (choosing[i] == true) ; while (ticket[i] != 0 && ticket[i] < ticket[x]) ; if (ticket[i] == ticket[x] && i < x) while (ticket[i] != 0 && ticket[i] == ticket[x]) ; } /* CRITICAL SECTION GOES HERE */ ticket[x] = 0; /* non-critical code */ }}
Blog
Briefly describe the difference between FIFO and round robin…
Briefly describe the difference between FIFO and round robin.
Give an example of how an algorithm might use spatial locali…
Give an example of how an algorithm might use spatial locality to fetch pages in an anticipatory scheme. For this question you do not have to use an actual algorithm covered in class. If it’s easier, you can just describe what an algorithm might do to accomplish this goal
Explain the advantage of SPF (shortest process first) over F…
Explain the advantage of SPF (shortest process first) over FIFO for scheduling. What goal is addressed?
Explain the difference(s) between a static priority scheme a…
Explain the difference(s) between a static priority scheme and a dynamic priority scheme.
Describe a characteristic of a scheduling algorithm that wou…
Describe a characteristic of a scheduling algorithm that would be good for a real-time system. Explain your answer.
A monitor is a construct designed to ensure mutual exclusion…
A monitor is a construct designed to ensure mutual exclusion. It uses the concept of a thread being “inside” or “outside” to do this.
Explain how linear ordering prevents deadlock.
Explain how linear ordering prevents deadlock.
Which of the following are stored in a PCB (processor contro…
Which of the following are stored in a PCB (processor control block)?
In MLF, it is possible for a process’s laxity to be a negati…
In MLF, it is possible for a process’s laxity to be a negative number.