PROCESS MANAGEMENT Flashcards

1
Q

What is a process? When does a program become a process

A

Process refers to a program in execution. A program becomes a process when an executable file is
loaded into memory

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

What is the difference between a process and a program

A

A program is a passive entity, such as a file containing a list of instructions stored on disk (often called an executable file), whereas a process is an active entity, with a program counter specifying the next instruction to execute and a set of associated resources.

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

Describe the structure of a process making sure to mention the text, stack, data and heap sections

A

-A process is more than the program code, which is sometimes known as the text section.
-It also includes the current activity, as represented by the value of the program counter and the contents of the processor’s registers.
-A process generally also includes the process stack, which contains temporary data (such as function parameters, return addresses, and local variables)
-And a data section, which contains global variables.
-A process may also include a heap, which is memory that is dynamically allocated during process run time.

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

Illustrate the structure of a process

A

*See notes

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

Illustrate the process life-cycle

A

*See notes

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

Explain the 5 stages of the process life-cycle

A

a) Start
This is the initial state when a process is first started/created.

b) Ready
-The process is waiting to be assigned to a processor.
-Process may come into this state after Start state or while running it by but interrupted by the scheduler to assign CPU to some other process.

c) Running
-Once the process has been assigned to a processor by the OS scheduler, the process state is set to running and the processor executes its instructions.

d) Waiting
-Process moves into the waiting state if it needs to wait for a resource, such as waiting for user input, or waiting for a file to become available.

e) Terminated or Exit
-Once the process finishes its execution, or it is terminated by the operating system, it is moved to the terminated state where it waits to be removed from main memory.

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

What is process control block?

A

-A Process Control Block is a data structure maintained by the Operating System for every process.
-The PCB is identified by an integer process ID (PID).
-A PCB keeps all the information needed to keep track of a process.

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

Describe the following:
Process state
Process privileges
Process ID
Pointer
Program Counter

A

-Process State
The current state of the process i.e., whether it is ready, running, waiting, or whatever.

-Process privileges
This is required to allow/disallow access to system
resources.

-Process ID
Unique identification for each of the process in the
operating system.

-Pointer
A pointer to parent process.

Program Counter
-Program Counter is a pointer to the address of the next instruction to be executed for this process.

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

Describe the following:
CPU Scheduling information
CPU registers
Memory management
Accounting Information
I/O status information

A

CPU registers
Various CPU registers where process need to be stored for execution for running state.

CPU Scheduling Information
Process priority and other scheduling information which is required to schedule the process.

Memory management information
This includes the information of page table, memory
limits, Segment table depending on memory used by the operating system.

Accounting information
This includes the amount of CPU used for process
execution, time limits, execution ID etc.

IO status information
This includes a list of I/O devices allocated to the process.

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

What is process scheduling?

A

Process scheduling refers to the activity of the process manager that handles the removal of the running process from the CPU and the selection of another process on the basis of a particular strategy.

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

Describe the process scheduling queues

A

Job queue
This queue keeps all the processes in the system.

Ready queue
This queue keeps a set of all processes residing in
main memory, ready and waiting to execute. A new
process is always put in this queue.

Device queues
The processes which are blocked due to unavailability of an I/O device constitute this queue.

*ready and run queues can only have
one entry per processor core on the system.

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

What happens when the state of a process changes in terms of processing scheduling queues

A

When the state of a process is changed, its PCB is unlinked from its current queue and moved to its new state queue.

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

Illustrate the Process scheduling Queues

A

*See notes

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

Describe the two-state process model

A

Two-state process model refers to running and non-running states
Running
When a new process is created, it enters into the system as in the running state.

Not Running
-Processes that are not running are kept in queue, waiting for their turn to execute. Each entry in the queue is a pointer to a particular process. The queue is implemented by using linked list.
-Use of dispatcher is as follows. When a process is interrupted, that process is transferred in the waiting queue. If the process has completed or aborted, the process is discarded. In either case, the dispatcher then selects a process from the queue to execute.

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

What is a scheduler and what are the different types?

A

These are special system software which handle process scheduling in various ways.
Their main task is to select the jobs to be submitted into the system and to decide which process to run.
They are of three types:
-Long-Term Scheduler
-Short-Term Scheduler
-Medium-Term Scheduler

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

Describe the long-term scheduler highlighting its main objective

A

-It is also called a job scheduler.
-It determines which programs are admitted to the system for processing. It selects processes from the queue and loads them into memory for execution.
-The primary objective of the job scheduler is to provide a balanced mix of jobs, such as I/O bound and processor bound. It also controls the degree of multiprogramming. If the degree of multiprogramming is stable, then the average
rate of process creation must be equal to the average departure rate of processes leaving the system.

*Time-sharing operating systems have no long term scheduler.
*When a process changes the state from new to ready, then there is use of long-term scheduler.

16
Q

Describe the short-term scheduler highlighting its main objective

A

-It is also called as CPU scheduler.
-The main objective of the short term scheduler is to
increase system performance in accordance with the
chosen set of criteria.
- It is the change of ready state to running state of the process. CPU scheduler selects a process among the processes that are ready to execute and allocates CPU to one of them.
-Short-term schedulers, also known as dispatchers, make the decision of which process to execute next. -Short-term schedulers are faster than long-term schedulers.

16
Q

Describe the Middle-term scheduler

A

Medium-term scheduling is a part of swapping. It removes the processes from the memory. It reduces the degree of multiprogramming.
The medium-term scheduler is in-charge of handling the swapped out-processes.

17
Q

Describe swapping

A

-A running process may become suspended if it makes an I/O request. A suspended processes cannot make any progress towards completion.
-In this condition, to remove the process from memory and make space for other processes, the suspended process is moved to the secondary storage.
-This process is called swapping, and the process is said to be swapped out or rolled out. Swapping may be necessary to improve the process mix.

18
Q

Compare the three schedulers in terms of :
multiprogramming, speed, process they deal with and presence in time-sharing systems

A

*See notes

19
Q

What is context switching and why is it important? Illustrate this concept

A

A context switch is the mechanism to store and restore the state or context of a CPU in Process Control block so that a process execution can be resumed from the same point at a later time.
Using this technique, a context switcher enables multiple processes to share a single CPU. Context switching is an essential part of a multitasking operating system features.

*See notes for pic

20
Q

Explain what happens when the scheduler switches the CPU from executing one process to execute another,

A

The state from the current running process is stored into the process control block.
After this, the state for the process to run next is loaded from its own PCB and used to set the PC, registers, etc. At that point, the second process can start executing.

21
Q

What information is stored for future use when a process is switched?

A

-Program Counter
-Scheduling information
-Base and limit register value
-Currently used register
-Changed State
-I/O State information
- Accounting information