Schemaläggningsalgoritmer Flashcards

1
Q

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.

A

First In, First Out (FIFO)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

If jobs come it at the same time it is the most optimal scheduling algorithm for turnaround time. It is non preemptive.

A

Shortest Job First (SJF)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If a new job arrives this scheduler determines which of the remaining jobs has the least time left and completes that one first.

A

Shortest Time To Completion First (STCF)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Problems with SJF

A

It is non-preemptive so a convoy effect can happen where short jobs can be scheduled behind longer jobs. Jobs run to completion.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is turnaround time?

A

Time of completion - Time of arrival. It is a performance metric.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is response time?

A

Time of first run - Time of arrial. How long it takes for a new job to run.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Name three perfomance metrics

A

Turnaround time, Fairness, Response time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a preemptive scheduler, name an example?

A

A preemptive scheduler can perform a context switch, stopping one running process temporarily and resuming another. Shortest time to completion first.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a non-preemptive scheduler, name an example?

A

Each job will run to completion before considering if to run a new job. Shortest job first.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is amortization? When it is commonly used?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Name a couple of fair schedulers?

A

Round robin,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to maximize the utilization of systems when performing disk I/O.

A

Overlap. Letting another job run while the issuing job waits for I/O to complete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What happens to a job when it issues a I/O request?

A

It gets blocked

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What happens when a I/O request completes?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Problems MLFQ tries to solve.

A

Optimize turnaround time and minimize response time while not knowing how long it will take for a job to complete.

17
Q

How does the MLFQ work?

A

MLFQ has a number of distinct queues, each assigned a different priority level. At a given time, a job ithat is ready to run is on a single queue. MLFQ uses priorities to decide which job should run on a given time.

18
Q

Where is a job with higher priority placed on which type of queue, higher or lower?

A

Higher

19
Q

How does MLFQ decide which job to run with the same priority?

A

Run the jobs in a round robin fashion.

20
Q

Which jobs does MLFQ treats as higher priority?

A

Responsive jobs, which issues many I/O.

21
Q

How does MLFQ change priority and approximates SJF?

A

If a job runs it entire timeslice it priority will be lowered. Jobs first entering have high priority. A move down the queues.

22
Q

How does MLFQ deal with starvation?

A

If there are many jobs with high interactivity the lower priority longer jobs will starve. Priority boost to boost all of the jobs in the system, increasing their priority.

23
Q

How does MLFQ deal with gameing?

A

Scheduler keep track once a process has used its allotment, it is demoted to the next priority queue.

24
Q

What is gameing?

A

A job relinquishing the CPU right before the time slices expires.

25
Q

How does MLFQ very time-slice length across the queues?

A

High priority queues are given short time slices, low priority queues have longer time slices.

26
Q

State the 5 rules of MLFQ

A

Rule 1: If priority(A) > Priority(B), A runs
Rule 2: If priority(A) = Priority(B), A & B run in RR
Rule 3: When a job enters the system, it is placed at the highest priority, top most queue.
Rule 4: Once a job uses up its time alotment its priority level is decease.
Rule 5: After time S, move all the jobs in the system to the topmost queue.

27
Q

How does the lottery scheduling work?

A

A process gets a percantage of the total tickets. The schedular know how many total tickets there are, the scheduler then picks a random winning ticket. It is probalistic.

28
Q

When do we want to use a lottery scheduling algorithm?

A

When we want each process to run at the CPU a percantage of time.

29
Q

When a process temporarily hand off its tickets to another process.

A

Ticket transfer

30
Q

A process can temporarily raise or lower the number of tickets it owns.

A

Ticket inflation.

31
Q

When doesnt ticket inflation make sense?

A

When the processes does not trust eachother.

32
Q

Advantages of lottery scheduling:

A

Simplicity of its implementation, no global state.

33
Q

How do we make two jobs finnish at the same time using lottery scheduling?

A

We use unfairness metric.

34
Q

Metric of which is simple the time the first job completes divided by the time that the second job completes.

A

Unfairness metric, U.

35
Q

Name a deterministic fair-share scheduler

A

Stride scheduling

36
Q

Explain stride scheduling

A

Every process has a stride length (highnumber / tickets). And it has a counter to track its global progress (pass value). Scheduler then uses the stride and pss to determine which process should run next. The scheduler will pick the process with the lowest passvalue to run.