Process Management Flashcards
What is a program?
A specfic set of ordered operations for a computer to perform/ Its execution involves a sequence of instructions within the program.
What is a process?
An instance of a program running on a computer. It executes instructions from main memory, according to the Program Counter (PC) register.
What is a process descriptor composed of?
Program, Data, and PCB (process control block)
What does the Process Control Block contain?
It contains the state of the process in execution and maps the environment state on the physical machine state.
Define an Inter-Process Relationship and name the two types of Inter-Process relationships.
A computer could be executing multiple processes at the same time, therefore, processes have inter-process relationships.
Compeition - processes are trying to get access to different resources of the system.
Cooperation - sometimes the processes need to communicate between themselves and exchange info.
What does the Process Manager implement?
CPU sharing (scheduling), i.e allocate resources to processes in conformance with certain policies.
Process Synchronisation and inter-process communication, i.e. deadlock strategies and protection mechanisms.
Explain how the two-state model works.
When the OS creates a new process, it enters it into the Not Running state, after that, the process exists, is known to the OS and waits for the oppurtunity to run. From time to time, the currently running process will be interrupted and the dispatcher process will select a new process to run.
How is a process created in the two state model?
The OS builds the data structures that are used to manage the process and allocates space in main memory to the process.
What are some reasons for process creation and process termination?
Process creation:
- New batch job
-Interactive logon
-Created by OS to provide service
-Spawned by existing process
Process termination:
-Natural Completion
-Time limit exceeded
-Errors
-Parent request
-Parent termination
How does the queuing system operate in the two state model?
Each process needs to be represented by the info relating to each process (incl Current state and location in memory). The processes waiting should be kept in some sort of queue. An interrupt process is transferred to the waiting queue and the dispatcher selects a process from the queue to execute.
Name and explain the 5 states in the five state model.
Running: The process is currently being executed.
Ready: A process that is prepared to execute when given the turn.
Blocked: A process that has been created, but not yet accepted in the pool of executable processes by OS.
Exit: A process that has been released from the pool of executable processes by the OS.
Describe how to queuing discipline works in the five state model.
There are now 2 queues: When the process is admitted to the system, it is placed in the ready queue. When a process is removed from the processor, it is either placed in the ready queue or blocked queue. When an event occurs, all processes waiting on the event are moved from the blocked queue to the ready queue.
What state is introduced to the five state model that makes the processor faster.
A suspended state is added. The processes that end up here are swapped to disk to free up more memory.
What are the 4 components of an OS control structure?
- Memory Tables
- I/O Tables
- File Tables
- Primary Process Table
What is a thread?
A lightweight process that is the unit of execution we use to dispatch. It is also a unit of computation associated with a process. It’s faster to create a thread than a process. The process is the execution environment for a family of threads sharing the same resources (e.g files, memory, space). A thread belongs to only 1 process.
the smallest series of related instructions involved in a process