CS 318
From a user's perspective, the system would appear to be extremely overloaded. There would be very long waits for responses from the system. I/O bound processes would tend to obscure this effect.
Too many of the processor's cycles would be used for the overhead inherent in context switching. Response times would be less than in the previous case, but turnaround times would be much greater than the ideal.
When users stopped complaining about response and turnaround times. When quantums are adjusted so that users are happy with these times, each user feels that they have the machine to themselves. From the system's standpoint, we want to minimize overhead and maximize job throughput.
A user then could write a signal handler which, for instance, halted the system, thus circumventing system security.
UserMode
machine instruction which places the machine in user
mode.)
Construct the system so that the following wrapper is called in response to a signal. This wrapper places the system back in user mode then invokes the user's signal handler. This preserves system integrity.
userSignalHandlerWrapper(argList) { userMode; invoke the user's signal handler, passing argList; }
int FAI(int& val) { return val++; // Performed atomically. }Devise a solution to the critical section problem for n processes using this instruction. Instead, model your solution on the manner in which a bakery, for instance, serializes customer service by means of a number dispenser. Prove that your solution meets the three criteria of a solution to the critical section problem. Solutions which treat the FAI instruction as a ``glorified'' TAS instruction will be down-graded. Likewise, simple ports of the bakery algorithm will be down-graded.
// Global variables. int current = 0; int next = 0; mutexbegin() { int myTicket = fai(next); while (current != myTicket) ; } mutexend() { ++current; }If n is less than MAXINT (usually the case), this will work even in the face of integer overflows.
Correctness: