A user level program can disable the timer interrupt and prevent context switching from taking place if it is given the ability to disable interrupts. This also allows it to use the processor without letting other processes execute.
5.11
It depends on how interrupts are implemented, but regardless, it is not a good choice of techniques. For example, if interrupts are disabled for one processor the result will be that the threads running on other processors can ignore synchronization and access the shared data.
5.12
You can’t hold a spin lock while you gain a semaphore because you might need to sleep while waiting for the semaphore. You can’t sleep while holding a spin lock.
5.13
Kernel data structures can include a pid management system, …show more content…
In this state, a higher-priority process will get a larger chunk of the CPU time than a lower-priority process. The root user needs to be able to set a higher priority to those processes that are going to take up the most time.
6.19
Priority and Shortest Job First
6.20
The process would be ran twice as fast.
Advantages: Prevents starvation of lower priority processes and it allows the user to prioritize more important processes. Disadvantages: Context switching will now have a larger effect than before and removing processes from the running queue is now significantly harder.
Allow the quantum time for each process to be based on each individual process time.
6.21
The time quantum is 1 millisecond: Regardless of the process that is scheduled, the scheduler experiences a 0.1 millisecond context-switching cost for every context-switch. This results in a CPU utilization of 1/1.1 * 100 =