How could cooperating threads implement mutual exclusion primitives in the system mentioned in the previous exercise?
What will be an ideal response?
There could be an integer to which all the threads had access. When a thread wished to execute critical section code, that thread would disable interrupts and check the value of the integer. If the integer indicated that another thread was already executing in its critical section, the thread trying to enter its critical section would just keep trying. To exit a critical section, a thread would just disable interrupts, set the integer to indicate that another thread can enter its critical section, then reenable interrupts.
You might also like to view...
________ allows you to select settings and choose what actions you want the computer to take
A) A dialog box B) A tab C) A gallery D) The Ribbon
The world in which the MMOG action takes place is created and managed by special computers called ____.
A. game hosts B. game servers C. game clients D. game servlets