[OS] Chapter 3 - Process Management

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/48

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

49 Terms

1
New cards

Process

is the execution of a program that performs the actions specified in that program.

2
New cards

Text section

comprises the compiled program code, read in from non-volatile storage when the program is launched.

3
New cards

Data section

stores global and static variables, allocated and initialized prior to executing main.

4
New cards

Heap

is used for dynamic memory allocation, and is managed via calls to new, delete, malloc, free, etc.

5
New cards

Stack

is used for local variables.

6
New cards

Stack overflow

If stack and heap ever meet, then either a __________ error will occur, or else a call to new or malloc will fail due to insufficient memory available.

7
New cards

Process Management

involves various tasks like creation, scheduling, termination of processes, and a dead lock.

8
New cards

Process states

a condition of the process at a specific instant of time. It also defines the current position of the process.

9
New cards

New

process is created when a specific program calls from secondary memory/hard disk to primary memory / RAM.

10
New cards

Ready

the process should be loaded into the primary memory which is ready for execution.

11
New cards

Running

the process is in execution.

12
New cards

Waiting

the process cannot run at the moment, because it is waiting for some resources to become available or for some event to occur.

13
New cards

Terminated or Halted

process has completed.

14
New cards

Context switching

  • is the process of saving the context of one process and loading the context of another process.

  • In simple terms, it is like loading and unloading the process from running state to ready state.

15
New cards

Context switching

  • happens when:

    • When a high-priority process comes to ready state (i.e. with higher priority than the running process)

    • An interrupt occurs

    • User and kernel mode switch (though, this is not necessary)

    • Preemptive CPU scheduling is used.

16
New cards

Context switching

process of saving and restoring the state of a CPU so that multiple processes can share a single CPU resource.

17
New cards

Context switching

are triggered by the OS scheduler, which decides which process should run next based on scheduling policies.

18
New cards

Mode switch, or privilege level switch

refers to the transition of the CPU from one privilege level to another.

19
New cards

Mode switch, or privilege level switch

occurs when CPU privilege level is changed, for example when a system call is made, or a fault occurs.

20
New cards

fork()

duplicates the current process to create a new one in Unix-like operating system.

21
New cards

spawn()

creates a new process or thread, often at a higher level of abstraction, in various programming languages and environments.

22
New cards

Initialization

Operating system prepares for process creation.

23
New cards

Allocation of Process ID (PID)

Unique identifier assigned to the new process.

24
New cards

Memory Allocation

Space allocated for code, data, heap, and stack.

25
New cards

Creation of Process Control Block (PCB)

Data structure initialized to manage the process.

26
New cards

Scheduling

Process scheduled for execution based on OS scheduling policy.

27
New cards

Execution

Process begins executing its instructions.

28
New cards

fork()

to create a child process

29
New cards

exit()

to terminate a child process

30
New cards

wait()

parent process waits for a child process

31
New cards

exec()

process overwrites itself with another executable program

32
New cards

Process termination

occurs when the exit system is called.

33
New cards

Deallocated

When a process exits, resources, memory, and I/O devices are all _________.

34
New cards

Multiple threads

are contained within a process. 

35
New cards

Thread

is the segment of a process which means a process can have multiple threads.

36
New cards

Multithreading

The ability of a program to execute multiple threads concurrently within a single process, allowing for parallel execution of tasks and efficient utilization of resources is called ___________.

37
New cards

Long-term scheduler

(a.k.a. job scheduler) – selects process from the queue and puts them in the memory for it to be executed.

38
New cards

Short-term scheduler

(a.k.a. CPU scheduler) – manages process that are ready to execute and allocates CPU to one of them.

39
New cards

Medium-term scheduler

(a.k.a. swapper) – manages the swapping of processes in the main memory and secondary memory.

40
New cards

Process scheduling

is the process manager’s ability to remove running process from the CPU and selecting another process through a particular strategy.

41
New cards

Main goal of Process Scheduling

  • keep the CPU occupied all the time; and 

  • provide the least amount of response time for every program.

42
New cards

Two (2) scheduling categories

  • Non-preemptive scheduling

  • Preemptive scheduling

43
New cards

Arrival Time (AT)

time at which the process arrives in the ready queue.

44
New cards

Completion Time

time at which processes completes its execution.

45
New cards

Burst Time (BT)

time require by a process for CPU execution.

46
New cards

Turn Around Time (TT or TaT)

time difference between completion time and arrival time.

47
New cards

Waiting Time (WT)

time difference between turn around time and burst time.

48
New cards

Non-Preemptive Algorithms

  • First Come First Serve (FCFS)

  • Shortest Job First (SJF)

  • Non-Preemptive Priority (NPP)

49
New cards

Preemptive Algorithms

  • Round Robin (RR)

  • Shortest Remaining Time First (SRTF)

  • Preemptive Priority (PP)