CSC 4103: Ch 5 CPU Scheduling

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play

1/53

encourage image

There are no tags or description

Looks like no tags are added yet.

54 Terms

1
New cards

CPU-I/O Burst Cycle

A cyclic process of execution that consists of CPU bursts and I/O bursts

2
New cards

CPU burst

an execution where the CPU loads, adds, stores, and reads from the file/command. It always begins and ends a process

3
New cards

I/O burst

an execution where the system waits for the I/O block to complete of the requested data/command

4
New cards

CPU Scheduler (short-term scheduler)

Selects from process in memory that are ready to execute and allocating the CPU (giving processing time)

5
New cards

When can CPU scheduling take place during a process?

When it…

  1. Switches from running to waiting state

  2. Switches from running to ready state

  3. Swtiches from waiting to ready state

  4. Terminates


6
New cards

Nonpreemptive Scheduling

When CPU scheduling happens ONLY when the process:

  1. Switches from running to waiting

  2. terminates


7
New cards

Dispatcher

Gives control of the CPU to the process chosen by the CPU scheduler. Including

  1. Switching context

  2. Switiching to user mode

  3. Jumping to the proper locaiton in the user program to restart that program


8
New cards

Dispatch latency

Time it takes the dispatcher to stop on process and start another

9
New cards

Context Switching

When the CPU pauses a currently running process/thread, saves its state, and loads the saved state of ANOTHER process/thread so that it can run

10
New cards

User mode

Restricted execution state where standard apps (like games, web browsers etc) run with limited privlieges. Has no access to hardware or core system memory.

11
New cards

Kernel Mode

Grants full hardware and memory access, and runs core OS components.

12
New cards

Dispatch vs. Context Switch

Dispatch is the broader process of handling CPU control, Context switch is one specific process

13
New cards

Scheduling Criteria

  1. CPU utilization (Max)

  2. Throughput (Max)

  3. Turnaround time (min)

  4. Waiting time (min)

  5. Response time (min)


However improving one often worsens another


14
New cards

CPU utilization

The percentage of time the CPU is actively executing something

15
New cards

Throughput

The # of processes that complete their execution per time unit

16
New cards

Turnaround time

The amount of time to execute a particular process. (Turnaround = completion time - arrival time)

17
New cards

Waiting time

Amount of time a process has been waiting in the ready queue

18
New cards

Response time

amount of time it takes from when a request is submitted until the first response is made

19
New cards

“First-Come, First-Serve” (FCFS) Scheduling

AKA FIFO scheduling. Executes processes in the exact order they arrive to the ready queue. It is Nonpreemptive as the process keeps the CPU unitl it releases it by either, terminating or requesting I/O

20
New cards

Burst time (execution time)

Total time a process actually needs to run on the CPU for execution

21
New cards

Convoy effect

When a short process waits behind a long process

22
New cards

Shortest job first Scheduling (SJF)

A algorithim which chooses to execute the process with the smallest CPU burst time, NEXT. If the burst times are the same, FCFS is used to break the tie.

23
New cards

Why is SJF considered to be an optimal algorithm

Because it gives the minimum average waiting time for a given set of processes, (short processes go first decreasing overall wait time) but the difficulty is knowing the length of the next CPU request

24
New cards

Types of SJF scheduling

  1. Non-Preemptive:

    1. Once the process is allocated to the CPU it cannot be preempted until it completes its CPU burst

  2. Preemptive:

    1. If a new process arrives with CPU burst length that is LESS than the time of the currently executing process, preempt. (can suffer from starvation)


25
New cards

Shortest remaining time first (SRTF)

An algorithm that chooses the process with the smallest remaining burst time. If their is a process currently running that has a greater remaining time than another, it will be preempt and sent back into ready state.

26
New cards

Preemptive Scheduling

The OS can forcibly interrupt a running process to assign a new processto the CPU. The removed process is sent back into the ready state.

It helps improve average wait time

27
New cards

Starvation (indefinite blocking)

When a process is perprtually being denied the resources it needs to execute because other processes continuously claim them

28
New cards

Priority Scheduling

A priority number is associated with each process, the process with the highest priority (smallest integer) gets chosen to execute. if there is a tie FCFS is used.

Can suffer from starvation but can be solved with Aging

29
New cards

Aging

As time progresse, increase the priority of the process

30
New cards

Preemptive Priority Scheduling

High priority new arrivals preempt the low-priority

31
New cards

Non-Preemptive Priority Scheduling

Simply moves the job at the head of the ready queue

32
New cards

Round Robin (RR)

Each process is given a small unit of CPU time (time quantum q), after the time has run out the process is preempted and added to the end of the ready queue


If there are n processes in the ready queue and q then each process gets 1/n of the CPU time in chucks of AT MOST q time units at once.

33
New cards

Bound waiting time

No process waits more than (n-1)q time units

34
New cards

Round Robin performance

If q is too LARGE = FIFO

If q is too SMALL = contet switch overhead is too high

35
New cards

Multilevel Queue

CPU scheduling method that divides the ready queue into seperate queues based on process traits (ex. priority, type, memory size,) before permanately assigning each process to one queue

36
New cards

Types of Multilevel queues

  1. Foreground: interactive, user level apps that need quick response times (RR)

  2. background: batch, long-running jobs without user interaction (FCFS)


37
New cards

Fixed Priority scheduling

A scheduling method where each process gets a priority value before execution, and the scheduler always runs the highest-priority ready task.

38
New cards

Multilevel Feedback Queue

Uses multiple priority queues and moves processes between them based on their past behavior.


39
New cards

Asymmetric multiprocessing

Type of processing where there is one master server (processor) that does all the scheduling including I/O processing and other system activites while the other processors only execute user codes

40
New cards

Symmetric multiprocessing (SMP)

Each processor is self-scheduling where they are all provided their own queue and utilize a common ready queue. often deals with processor affinity and load balancing

41
New cards

Processor affinity

Binds a process to execute only on a specfic CPU core or set of cores

42
New cards

Soft affinity

When the scheduler attempts to keep a process on the same core but will move it to another core if the current one gets overloaded

43
New cards

Hard affinity

When a process is strictly locked to a specifc cores, forbidding the OS from moving it (this is where most processor affinity problems come from)

44
New cards

Processor sets

A logically grouped subsets of system’s processors or cores dedicated to running specific processes or threads

45
New cards

Symmetric Multithreading (SMT)

Allows a single physical CPU core to execute instructions from multiple independent threads at the same time by treating each hardware thread as s seperate virutal core (logical processor)

<p>Allows a single physical CPU core to execute instructions from multiple independent threads at the same time by treating each hardware thread as s seperate virutal core (logical processor)</p>
46
New cards

Load Balancing

Attempts to keep workload evenly distributed across multiple CPUs or processor cores in a SMP system

47
New cards

Push migration

A dedicated task periodically checks the workload on each CPU core and moves processes from heavily loaded processors to idle or less-busy ones

48
New cards

pull migration

Load-balancing techniques in SMP systems where an idle processor actively takes a waiting task from the ready queue of a busy processor

49
New cards
50
New cards
51
New cards
52
New cards
53
New cards
54
New cards