Does the algorithm guarantee mutual exclusion b is it


A proposed algorithm for mutual-exclusion works as follows:

Let there be a multi-writer register roll, whose range is {-1, 0, . . . ,N- 1} and the initial value is -1. To enter the critical section, a process i spins on roll, until the value is -1. And when it finds the value to be -1, it sets the value of roll to i, within one time unit of the read.

After that, the process waits for more than one time unit, and then reads roll. If it still has the value i, then it enters the critical section.

Otherwise, it returns to spinning on roll until the value is -1. When a process exits its critical section, its sets the value of roll to -1.

(a) Does the algorithm guarantee mutual exclusion?
(b) Is it livelock-free?
(c) What are the drawbacks of this algorithm (in terms of performance and requirement)?

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Does the algorithm guarantee mutual exclusion b is it
Reference No:- TGS02396887

Now Priced at $10 (50% Discount)

Recommended (95%)

Rated (4.7/5)