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...
A thread uses________to monitor the state of an object or to be notified when an event occurs.
a) a condition variable. b) another thread. c) a semaphore. d) None of the above.
Which of the following is a reason that transaction logs must be backed up frequently?
A. so you don't have to spend time backing up data files B. frequent backups increase the likelihood of a corrupt active transaction log C. when the log is backed up, it is truncated D. the tail of the log increases each time the log is backed up
What is the motherboard form factor?
A) The motherboard size B) The CPUs allowed on the motherboard C) The method of controlling memory modules D) The customer satisfaction rating over a 1-year period
When evaluating the efficiency of a search operation, you take a look at the ratio of true positives to false positives. The correct term for this statistic is ___________________
a. Precision b. Relevance c. Recal d. Dominance