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...

Access lets you create a special macro named ____ that runs automatically when a database is opened.

A. AutoExec B. AutoStart C. Run D. StartForm

Computer Science & Information Technology

Every new cell/smartphone has to include a GPS chip

Indicate whether the statement is true or false

Computer Science & Information Technology

The preferred passdb backend introduced in Samba 3.4.0 is ____.

A. smbpasswd B. tdbsam C. passwd D. passsmb

Computer Science & Information Technology

In Access, the term ________ is synonymous with "formula."

Fill in the blank(s) with correct word

Computer Science & Information Technology