Chap 6 Flashcards

1
Q

Scheduling

A

◼ The scheduler chooses one of the ready threads to allocate to the CPU when it is available.
◼ The scheduling policy determines when it is time
for a thread to be removed from the CPU and allocate it to another thread.
◼ The scheduling mechanism determines how the
process manager can determine it is time to interrupt the CPU, and how a thread can be
allocated to and removed from the CPU.

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

Scheduling Mechanisms

A

 When a process/thread is changed into the ready
state, the enqueuer enqueues the corresponding
descriptor into a list of processes that are waiting for
the CPU (or the ready list). The enqueuer may place
the new process anywhere in the list, depending on
the scheduling policy.
 When the scheduler switches the CPU from executing
one process to another, the context switcher saves
the contents of all CPU registers (PC, IR, condition
status, processor status, and ALU status) for the
thread being removed into its descriptor.
 The dispatcher is invoked after the current process is
removed from the CPU. The dispatcher removes one
of the threads from the ready list and then allocates it
to the CPU by loading its CPU registers in the
thread’s descriptor into the CPU.

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

First-Come First-Served FCFS (advantage & disadvantage)

A

◼ Advantages:
Simplest CPU scheduling algorithm
◼ Disadvantage
Convoy effect: short process behind long process and waiting for the long process to finished. This results in lower CPU and
devices utilization.

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

Shortest-Job-First (SJF) Two methods

A

 nonpreemptive - Once CPU is allocated to a process it cannot
be preempted until it completes its service time.
 preemptive - A current process is preempted if a new process
arrives with service time length lesser than the current process’s
remaining service time.

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

Priority Scheduling (problem and solution)

A

◼ Problem: Starvation
 Low priority processes may never be executed.
◼ Solution: Aging
 Increase the priority of the process as time
progresses.

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

Round-Robin (RR) Performance

A

Performance. It depends on size of time quantum:
 large quantum (q). This is equivalent to FIFO.
 small quantum (q). It must be large with respect to the context
switch, otherwise overhead is too high.

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