Schemaläggningsalgoritmer Flashcards
Simple to implement, if jobs come in at a certain order it can create a convoy effect. Jobs get completed one at a time in the order they were scheduled by the time of arrival.
First In, First Out (FIFO)
If jobs come it at the same time it is the most optimal scheduling algorithm for turnaround time. It is non preemptive.
Shortest Job First (SJF)
If a new job arrives this scheduler determines which of the remaining jobs has the least time left and completes that one first.
Shortest Time To Completion First (STCF)
Problems with SJF
It is non-preemptive so a convoy effect can happen where short jobs can be scheduled behind longer jobs. Jobs run to completion.
What is turnaround time?
Time of completion - Time of arrival. It is a performance metric.
What is response time?
Time of first run - Time of arrial. How long it takes for a new job to run.
Name three perfomance metrics
Turnaround time, Fairness, Response time
What is a preemptive scheduler, name an example?
A preemptive scheduler can perform a context switch, stopping one running process temporarily and resuming another. Shortest time to completion first.
What is a non-preemptive scheduler, name an example?
Each job will run to completion before considering if to run a new job. Shortest job first.
Which type of scheduler algorithm is good for response time but horrible for turnaround time? Use terms as time slice. How long should a timeslice be?
Round robin. Is a cyclic scheduling algorithm which gives each process a timeslice. Which means a time to run on the CPU and then lets each process run its timeslice in a cyclic manner. It is fair becuase we avoid starvation.
What is amortization? When it is commonly used?
Used in systems when there is a fixed cost to some operation. Amortization is the process of making that cost occour less often, reduce the total cost of the system.
Name a couple of fair schedulers?
Round robin,
How to maximize the utilization of systems when performing disk I/O.
Overlap. Letting another job run while the issuing job waits for I/O to complete
What happens to a job when it issues a I/O request?
It gets blocked
What happens when a I/O request completes?
An interupt is raised and the OS runs and moves the process which issued the I/O from blocked to ready state. It could event decide to run the job at that point.