Explain how the example concurrent program that enforces mutual exclusion with testAndSet could lead to indefinite postponement. Indicate why this possibility would nevertheless be highly unlikely. Under what circumstances would it be acceptable to use this mutual exclusion technique? Under what circumstances would it be completely unacceptable?

What will be an ideal response?

Assume T1 has the lock (i.e., p1MustWait is true and p2MustWait is false) and that the system is a uniprocessor system that is currently executing T1’s critical section. If T1 exits its critical section, performs code in the noncritical section, and loops around to call testAndSet successfully before the processor switches to T2, then T1 will be able to execute its critical section again. This could keep happening, and T2 would never be able to execute its critical section.This possibility is highly unlikely, because it would require a small noncritical section, or else a timer interrupt would cause T2 to execute.Also, for T2to be indefinitely postponed,T1 would have to end up in the critical section whenever a quantum is up. In most systems, the ffuctuation of the timing hardware and the randomness of interrupts make this a highly unlikely scenario. Therefore, it is acceptable in most systems that allow for interrupts. However, it is unacceptable in mission-critical systems, because the smallest chance of its happening could lead to disaster.

Computer Science & Information Technology

You might also like to view...

To use a wizard to modify an existing data block or layout, you must start the wizard in ______ mode.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Systems that can continue to provide network functions after catastrophic hardware failure are said to have _______________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology