PROCESS MANAGEMENT Flashcards
What is a process? When does a program become a process
Process refers to a program in execution. A program becomes a process when an executable file is
loaded into memory
What is the difference between a process and a program
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.
Describe the structure of a process making sure to mention the text, stack, data and heap sections
-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.
Illustrate the structure of a process
*See notes
Illustrate the process life-cycle
*See notes
Explain the 5 stages of the process life-cycle
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.
What is process control block?
-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.
Describe the following:
Process state
Process privileges
Process ID
Pointer
Program Counter
-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.
Describe the following:
CPU Scheduling information
CPU registers
Memory management
Accounting Information
I/O status information
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.
What is process scheduling?
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.
Describe the process scheduling queues
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.
What happens when the state of a process changes in terms of processing scheduling queues
When the state of a process is changed, its PCB is unlinked from its current queue and moved to its new state queue.
Illustrate the Process scheduling Queues
*See notes
Describe the two-state process model
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.
What is a scheduler and what are the different types?
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