The abstract-machine interface consists of the host-system hardware architecture and the system calls implemented by the operating system. The trap instruction is used to implement system calls. See Figure 6.6 in the text.
No: By the definition of SJN, the executing process has the shortest expected execution time. If it voluntarily leaves the CPU, it will be picked by the scheduler to be the next process to get the CPU; that is, it just performed a no-op with context-switch overhead.
Yes: The SJN property means the executing process has the shortest expected execution time. If a new process with a shorter expected execution time enters the system, the SJN property is violated. By occassionaly giving up the CPU the running process gives the scheduler an opportunity to run a process with a shorter expected execution time.
Most answers were one or the other of the arguments, with the first one being more popular.
A system's response time is the total execution time divided by the number of processes executed. The scheduler can effect this by making the total execution time either longer or shorter. Adding context switches to compute-bound processes makes them execute longer due to context-switch overhead; your colleague appears to be correct.
Many answers got side-tracked by long vs. short process examples without noticing that it's the total execution time that matters.
Your colleage adjusted the amount of time an interactive process spends in the CPU, but the important measure for responsiveness is the amount of time it takes for the ready process to reach the CPU. Your colleague should have provided a fast-path for interactive process to reach the CPU more quickly; this could have been done by, for example, modifying the ready queue to allow interactive process to enter somewhere in the middle of the queue, or by provided two ready queues, one for interactive processes and the other for non-interactive processes.
This page last modified on 14 November 2004.