Operating Systems - Lecture 3

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/33

flashcard set

Earn XP

Description and Tags

Process and Process State

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

34 Terms

1
New cards

Process

is a program in execution.

2
New cards

passive, active

A Program is ______; a process is _______.

3
New cards
  • Address Space

  • CPU State

  • OS Resources

Process Structure

4
New cards
  • New

  • Running

  • Waiting (Blocked)

  • Ready

  • Terminated

Process State

5
New cards

New

The process is about to be created but not yet created. It is the program that is present in secondary memory that will be picked up by OS to create the process.

6
New cards

Running

The process is chosen from the ready queue by the CPU for execution and the instructions within the process are executed by any one of the available CPU cores

7
New cards

Waiting (Blocked)

Whenever the process is _____  for an event, it enters the ______

state or ____state. The process continues to wait in the main memory and does not require CPU.

8
New cards

Ready

After the creation of a process, the process enters the ____ state. Processes that are ______ for execution by the CPU are maintained in a queue called ready queue.

9
New cards

Process Control Block (PCB)

  • Each process is represented in the operating system by a _____ also called a task control block.

  • It contains information associated with a specific process

10
New cards
  • Process State

  • Program Counter

  • CPU registers

  • CPU-Scheduling Information

  • Memory-Management Information

  • Accounting Information

  • I/O status Information

Process Control Block includes:

11
New cards

Process State

The state may be new, ready, running, waited, halted, etc.

12
New cards

Program Counter

The counter indicates the address of the next instruction to be

executed for this process.

13
New cards

CPU Registers

  • The registers vary in number and type, depending on the computer architecture.

  • They include accumulators, index registers, stack pointers, and general-purpose registers.

14
New cards

CPU-Scheduling Information

This information includes a process priority, pointers to

scheduling queues, and any other scheduling parameters

15
New cards

Memory Management Information

This information may include such items as the value of the base and limit registers and the page tables, or the segment tables, depending on the memory system used by the operating system

16
New cards

Accounting Information

This information includes the amount of CPU and real time used, time limits, account numbers, job or process numbers, etc.

17
New cards

I/O Status Information

This information includes the list of I/O devices allocated to the process, a list of open files, etc.

18
New cards

Process Scheduler

selects an available process (possibly from a set of several available processes) for program execution on a core

19
New cards
  • Ready Queue

  • Wait Queue

Scheduling Queues

20
New cards

Ready Queue

contains those processes that are ready to run

21
New cards

Wait Queue

contains those processes that are waiting for a certain event to occur

22
New cards

Context Switch

is a task where switching the CPU core to another process requires performing a state save of the current process and a state restore of a different process

23
New cards

State Save

performs a state save of the current state of the CPU core

24
New cards

State Restore

to resume operations

25
New cards
  • State save

  • State restore

Context Switch

26
New cards
  • Preemptive

  • Non-preemptive

Categories in Scheduling falls into two categories:

27
New cards

Non-preemptive

  • a process’s resource cannot be taken before the process has finished running.

  • when a running process finishes and transitions to a waiting state, resources are switched.

28
New cards

Preemptive

  • the OS assigns resources to a process for a predetermined period of time.

  • the process switches from running state to ready state or from waiting state to ready state during resource allocation.

29
New cards

Long Term or Job Scheduler

  • brings the new process to the Ready State.

  • it controls the Degree of Multi-programming

  • it increases efficiency by maintaining a balance between I/O and CPU-bound processes.

  • they operate at a high level and are typically used in batch-processing systems.

30
New cards

Short-Term or CPU Scheduler

• is responsible for selecting one process from the ready state for scheduling it on the running state.

• all scheduling algorithms are used.

• is responsible for ensuring no starvation due to high burst time processes.

31
New cards

The Dispatcher

is responsible for loading the process selected by the Short-term scheduler on the CPU (Ready to Running State) Context switching is done by the dispatcher only

32
New cards
  • Switching Context;

  • Switching to user mode;

  • Jumping to the proper location in the newly loaded program.

The dispatcher does the following:

33
New cards

Medium-Term Scheduler

  • it is responsible for suspending and resuming process.

  • it mainly does swapping (moving processes from main memory to disk and vice versa).

  • swapping may be necessary to improve the process mix or because a change in memory requirements has overcommitted available memory, requiring memory to be freed up.

  • is helpful in maintaining a perfect balance between the I/O bound and the CPU bound.

  • it reduces the degree of multiprogramming.

34
New cards

Degree of Multi-programming

the number of processes present in a ready state at any point in time.